Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
(example from the docs async-graphql https://async-graphql.github.io/async-graphql/en/subscription.html, juniper: https://github.com/graphql-rust/juniper/blob/master/docs/book/content/advanced/subscriptions.md)
Here’s a really simple example we use in Vector for streaming a ‘health’ check that returns the current server uptime: https://github.com/timberio/vector/blob/45da52c2c658893ba28044a807ecbaee1884d918/src/api/schema/health.rs#L31
I might even start smaller than that, and try creating a basic function using async-stream's stream! macro that just yields an incrementing i64 and return that from within a subscription, to get an idea for how it works.