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
| Language | Package | Transport | Async |
|---|---|---|---|
| Go | go get github.com/floruntime/flo-go | TCP | Goroutines |
| Python | pip install flo | TCP | asyncio |
| JavaScript (Node.js) | npm install @floruntime/node | TCP | Promise |
| Zig | flo-zig (build.zig.zon) | TCP | — |
Feature Matrix
| Feature | Go | Python | JS/TS | Zig |
|---|---|---|---|---|
| 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:
- Create a client with host, optional namespace, and timeout
- Connect to the server
- Use subsystem accessors —
client.kv,client.queue,client.stream,client.action,client.worker - 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:
| Error | Meaning |
|---|---|
NotFound | Key/queue/stream doesn't exist |
Conflict | CAS version mismatch |
BadRequest | Invalid parameters |
Unauthorized | Authentication failed |
Overloaded | Server at capacity, retry later |
Unavailable | No leader, or the shard takes no writes; with reason shard_halted the shard halted |
OutcomePending | The write committed but hasn't applied: its shard halted |
StaleNotFound | A KV get or JSON get on a halted shard found no key: absent as of the halt, not absent |
Internal | Server error |
NotConnected | Client 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.