Skip to content

Subscription endpoint#63

Merged
justinGilmer merged 3 commits intostagingfrom
subscription_endpoint
Nov 16, 2023
Merged

Subscription endpoint#63
justinGilmer merged 3 commits intostagingfrom
subscription_endpoint

Conversation

@justinGilmer
Copy link
Copy Markdown

Adds the subscription endpoint to btrdb.

andrewchambers and others added 3 commits August 22, 2023 22:57
This implementation also includes an example bytewax adapter
which can be used to process inserts with bytewax.

An example bytewax flow is shown below:

```
import uuid
import btrdb
from btrdb.experimental.bytewax_connectors import InsertSubscription
from bytewax.dataflow import Dataflow
from bytewax.connectors.stdio import StdOutput

def selector(db):
	# Selector can be anything that returns a list of uuids.
	rows = db.query('select uuid from streams')
	uuids = [uuid.UUID(row['uuid']) for row in rows]
	return uuids

flow = Dataflow()
flow.input("realtime_sub", InsertSubscription(selector, selector_refresh_interval=30))
flow.output("print_output", StdOutput())
```
@justinGilmer justinGilmer merged commit 19edda0 into staging Nov 16, 2023
@justinGilmer justinGilmer deleted the subscription_endpoint branch November 16, 2023 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants