-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor BlockPoller to support generics and client handling
Refactor BlockPoller to support generic clients with type parameter 'C'. Updated associated methods, test functions, and interfaces to accommodate this change. This enhancement includes moving the retry mechanism and client handling to the poller, improving flexibility for different client types.
- Loading branch information
Showing
8 changed files
with
278 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
package blockpoller | ||
|
||
import ( | ||
"context" | ||
|
||
pbbstream "github.com/streamingfast/bstream/pb/sf/bstream/v1" | ||
) | ||
|
||
type BlockFetcher interface { | ||
type BlockFetcher[C any] interface { | ||
IsBlockAvailable(requestedSlot uint64) bool | ||
Fetch(ctx context.Context, blkNum uint64) (b *pbbstream.Block, skipped bool, err error) | ||
Fetch(client C, blkNum uint64) (b *pbbstream.Block, skipped bool, err error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.