Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for event streaming API #1794

Merged
merged 60 commits into from
Dec 7, 2023
Merged

Conversation

jribbink
Copy link
Contributor

@jribbink jribbink commented Oct 30, 2023

This PR introduces the event streaming API & some infrastructure needed to enable streaming other realtime execution data.

  • New SDK response type introduced for "stream connection". These are represented by a lightweight interface defined in @onflow/types. Currently these streams are built using event emitters, however, this implementation can easily be substituted with our own in the future if necessitated
  • Resolving data streams in the SDK is defined as piping their contents to a new stream which separates data types by domain & resolves contents. (i.e. as of now we have both "events" and "heartbeat" data types passing through the event stream)
  • Websocket connections are built to reconnect to streams in the event of a disconnection/error. The event stream connection will always reconnect with the next blockId selected to resume its position

Currently, events streaming is only available on testnet. This PR cannot be merged until this feature exists on mainnet (or needs an experimental feature config flag). Release is also blocked by a couple of outstanding issues with REST events streaming.

@changeset-bot
Copy link

changeset-bot bot commented Oct 30, 2023

🦋 Changeset detected

Latest commit: 6b5b423

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@onflow/transport-grpc Patch
@onflow/fcl Minor
@onflow/sdk Minor
@onflow/transport-http Minor
@onflow/typedefs Minor
@onflow/fcl-wc Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jribbink jribbink force-pushed the jribbink/event-streaming branch from a58d455 to f8c4a60 Compare November 9, 2023 04:46
@jribbink jribbink marked this pull request as ready for review November 24, 2023 22:04
@jribbink jribbink requested a review from a team as a code owner November 24, 2023 22:04
@jribbink jribbink changed the title [WIP] Add support for event streaming API Add support for event streaming API Nov 24, 2023
@jribbink jribbink force-pushed the jribbink/event-streaming branch 2 times, most recently from cbcf879 to 62d9c28 Compare December 4, 2023 21:46
Copy link
Contributor

@nialexsan nialexsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@jribbink jribbink merged commit acf90a7 into master Dec 7, 2023
1 check passed
@jribbink jribbink deleted the jribbink/event-streaming branch December 7, 2023 16:56
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.

Support event streaming API
2 participants