feat: 30.2 — unified api surface

Merged
VI
7mo ago
+797-957

Summary

  • Update Python SDK for the unified proto API from Story 30.1
  • BatchEnqueue RPC removed; enqueue_many() replaces batch_enqueue()
  • EnqueueRequest now wraps repeated EnqueueMessage; EnqueueResponse returns repeated EnqueueResult with typed error codes
  • AckRequest/NackRequest now wrap repeated AckMessage/NackMessage with per-message results
  • ConsumeResponse only has repeated messages (singular message field removed)
  • BatchMode renamed to AccumulatorMode; BatchEnqueueResult to EnqueueResult; BatchEnqueueError to EnqueueError
  • Linger.batch_size renamed to Linger.max_messages
  • Per-message EnqueueErrorCode mapped to typed SDK exceptions (e.g. QUEUE_NOT_FOUND -> QueueNotFoundError)
  • Proto regenerated from unified service.proto; admin.proto synced

Test plan

  • 16 unit tests pass (batcher flush, accumulator modes, type constructors)
  • 15 integration tests pass against real fila-server (enqueue/consume/ack lifecycle, enqueue_many, accumulator modes, TLS, API key auth)
  • No "batch" prefix in public API

🤖 Generated with Claude Code


Summary by cubic

Aligns the Python SDK with the unified v1 gRPC API (Story 30.2): removes BatchEnqueue, adds enqueue_many(), and returns per‑message EnqueueResult with typed errors. Also simplifies consume responses and renames batching to accumulation.

  • New Features

    • Added enqueue_many(); replaces batch_enqueue() and returns list[EnqueueResult].
    • Per-message EnqueueErrorCode now maps to typed SDK exceptions (e.g., QUEUE_NOT_FOUND -> QueueNotFoundError).
    • ConsumeResponse only includes messages[] (singular message removed).
    • Ack/Nack protos now wrap repeated messages with per-message results.
    • Batching renamed to accumulation: AccumulatorMode replaces BatchMode; background AutoAccumulator/LingerAccumulator.
    • Linger.max_messages replaces Linger.batch_size.
    • Synced admin.proto; API key RPCs removed from generated stubs.
  • Migration

    • Replace batch_enqueue(...) with enqueue_many([...]) and handle list[EnqueueResult].
    • Update imports/types: BatchEnqueueResult -> EnqueueResult, BatchEnqueueError -> EnqueueError, BatchMode -> AccumulatorMode.
    • Update config: Linger.batch_size -> Linger.max_messages.
    • If you use raw protos, expect only messages[] in ConsumeResponse.