Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@maoueh
Copy link
Contributor

@maoueh maoueh commented Dec 16, 2021

The implementation of the never ending Firehose stream of blocks have been re-implemented using async-stream library. This will makes the implementation much more readable and maintainable in the future. This should enable re-using TriggersAdapter::triggers_in_block directly instead of having to defer to firehose_triggers_in_block (subsequent PR to come).

This also removes the notify_block_consumed callback on the FirehoseBlockStream and the latest active cursor to reconnect to is now saved inside the FirehoseBlockStream directly. This will make it easier to implement the BufferedBlockStream in the future.

Caveats Formatting of code inside try_stream! macro doesn't work, unclear if it's a general limitation in macros in general or this very specific macro.

The implementation of the never ending Firehose stream of blocks have been re-implemented using `async-stream` library. This will makes the implementation much more readable and maintainable in the future. This should enable re-using `TriggersAdapter::triggers_in_block` directly instead of having to defer to `firehose_triggers_in_block` (subsequent PR to come).

This also removes the `notify_block_consumed` callback on the `FirehoseBlockStream` and the latest active cursor to reconnect to is now saved inside the FirehoseBlockStream directly. This will make it easier to implement the `BufferedBlockStream` in the future.

*Caveats* Formatting of code inside `try_stream!` macro doesn't work, unclear if it's a general limitation in macros in general or this very specific macro.
Copy link
Collaborator

@leoyvens leoyvens left a comment

Choose a reason for hiding this comment

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

Amazing how much simpler this became

@maoueh maoueh merged commit 6c9229b into master Dec 17, 2021
@maoueh maoueh deleted the maoueh/feature/async-stream-firehose-block-stream branch December 17, 2021 19:59
kamilkisiela pushed a commit that referenced this pull request Jan 5, 2022
The implementation of the never ending Firehose stream of blocks have been re-implemented using `async-stream` library. This will makes the implementation much more readable and maintainable in the future. This should enable re-using `TriggersAdapter::triggers_in_block` directly instead of having to defer to `firehose_triggers_in_block` (subsequent PR to come).

This also removes the `notify_block_consumed` callback on the `FirehoseBlockStream` and the latest active cursor to reconnect to is now saved inside the FirehoseBlockStream directly. This will make it easier to implement the `BufferedBlockStream` in the future.

*Caveats* Formatting of code inside `try_stream!` macro doesn't work, unclear if it's a general limitation in macros in general or this very specific macro.

Co-authored-by: Matthieu Vachon <[email protected]>
kamilkisiela pushed a commit that referenced this pull request Jan 12, 2022
The implementation of the never ending Firehose stream of blocks have been re-implemented using `async-stream` library. This will makes the implementation much more readable and maintainable in the future. This should enable re-using `TriggersAdapter::triggers_in_block` directly instead of having to defer to `firehose_triggers_in_block` (subsequent PR to come).

This also removes the `notify_block_consumed` callback on the `FirehoseBlockStream` and the latest active cursor to reconnect to is now saved inside the FirehoseBlockStream directly. This will make it easier to implement the `BufferedBlockStream` in the future.

*Caveats* Formatting of code inside `try_stream!` macro doesn't work, unclear if it's a general limitation in macros in general or this very specific macro.

Co-authored-by: Matthieu Vachon <[email protected]>
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.

3 participants