SDK Overview

Official client SDKs for Go, Python, JavaScript/TypeScript, and Zig.

Flo provides official SDKs for four languages. All SDKs use the same binary wire protocol and support the full feature set: KV, Streams, Queues, Time-Series, Actions, and Workers.

Available SDKs

LanguagePackageTransportAsync
Gogo get github.com/floruntime/flo-goTCPGoroutines
Pythonpip install floTCPasyncio
JavaScript (Node.js)npm install @floruntime/nodeTCPPromise
Zigflo-zig (build.zig.zon)TCP—

Feature Matrix

FeatureGoPythonJS/TSZig
KV (get/put/delete/scan/history)✓✓✓✓
Queues (enqueue/dequeue/complete/fail/touch/DLQ list)✓✓✓✓
Streams (append/read/consumer groups)✓✓✓✓
Actions (register/invoke/status)✓✓✓✓
Workers (register/await/complete/fail)✓✓✓✓
Blocking gets / long polling✓✓✓✓
CAS (optimistic locking)✓✓✓✓
Worker framework (high-level)✓✓✓✓
Stream worker framework✓✓✓✓

Common Patterns

All SDKs follow the same pattern:

  1. Create a client with host, optional namespace, and timeout
  2. Connect to the server
  3. Use subsystem accessors — client.kv, client.queue, client.stream, client.action, client.worker
  4. Close when done
client = connect("localhost:9000", namespace="myapp")
client.kv.put("key", value)
client.queue.enqueue("tasks", payload)
client.stream.append("events", data)
client.close()

Namespaces

All operations default to the namespace configured on the client. You can override per-operation:

# Python
await client.kv.put("key", b"value")                           # uses default namespace
await client.kv.put("key", b"value", PutOptions(namespace="other"))  # override

A namespace separates names, not access: any client can name any namespace. See CLI → Namespaces.

Error Handling

All SDKs provide typed errors:

ErrorMeaning
NotFoundKey/queue/stream doesn't exist
ConflictCAS version mismatch
BadRequestInvalid parameters
UnauthorizedAuthentication failed
OverloadedServer at capacity, retry later
UnavailableNo leader, or the shard takes no writes; with reason shard_halted the shard halted
OutcomePendingThe write committed but hasn't applied: its shard halted
StaleNotFoundA KV get or JSON get on a halted shard found no key: absent as of the halt, not absent
InternalServer error
NotConnectedClient not connected

Every server error also carries the refusal's reason and ran (Refusals): ran says whether the request took effect, so decide whether to resend from it, not from the message. Go: ServerError.Reason/.Ran; JavaScript: ServerError.reason/.ran; Python: ServerError.reason/.ran; Zig: client.lastError().?.reason/.ran.

The SDKs retry unavailable by themselves, except from a halted shard: they never retry outcome_pending (the write is committed, so resending it would write it twice) or unavailable with reason shard_halted (it fails the same way until an operator repairs the shard). A worker's own registration, group join and polls do keep backing off on shard_halted, up to about 30 seconds apart, warning each time, and resume by themselves.