Skip to content

Feat: Trigger block stream immediately on height update in ChainStream.ts#16

Open
dzikowski-ai wants to merge 2 commits intoGalaChain:mainfrom
dzikowski-ai:immediate-stream-trigger-v2
Open

Feat: Trigger block stream immediately on height update in ChainStream.ts#16
dzikowski-ai wants to merge 2 commits intoGalaChain:mainfrom
dzikowski-ai:immediate-stream-trigger-v2

Conversation

@dzikowski-ai
Copy link

The fromBlock method in ChainStream.ts was modified to react immediately to chain height updates. Previously, it would wait for a grace period before checking for new blocks.

The expand operator in fromBlock now listens to changes in this.chainInfo. When the current block height is reached, instead of a fixed delay, it waits for this.chainInfo to emit a new height greater than the current block.

This commit only includes changes to src/ChainStream.ts.

…tream.ts

The `fromBlock` method in `ChainStream.ts` was modified to react immediately to chain height updates. Previously, it would wait for a grace period before checking for new blocks.

The `expand` operator in `fromBlock` now listens to changes in `this.chainInfo`. When the current block height is reached, instead of a fixed delay, it waits for `this.chainInfo` to emit a new height greater than the current block.

This commit only includes changes to `src/ChainStream.ts`.
Co-authored-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
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

Comments