Skip to main content
The IStream interface allows you to create custom streaming data sources for real-time collaborative data, pub/sub systems, or stateful streams.

IStream Interface

Implement the IStream<TData> interface to create custom stream backends.

Stream Operations

get()

Retrieve an item from the stream.
StreamGetInput
required
TData | null
The item data, or null if not found

set()

Set an item in the stream.
StreamSetInput
required
StreamSetResult<TData> | null
Result containing old and new values

delete()

Delete an item from the stream.
StreamDeleteInput
required
DeleteResult

list()

List all items in a group.
StreamListInput
required
TData[]
Array of all items in the group

listGroups()

List all groups in the stream.
StreamListGroupsInput
required
string[]
Array of group IDs

update()

Perform atomic updates on an item.
StreamUpdateInput
required
StreamUpdateResult<TData> | null

createStream()

Register a stream implementation with the III SDK.
string
required
Unique stream name
IStream<TData>
required
Stream implementation
This automatically registers the following functions:
  • stream::get(streamName)
  • stream::set(streamName)
  • stream::delete(streamName)
  • stream::list(streamName)
  • stream::list_groups(streamName)

Example: In-Memory Stream

Example: Redis Stream

Example: Database Stream

Use Cases

Implement operational transformation or CRDTs for collaborative editing:
Store events and compute state from event history:
Add caching on top of another data source: