Skip to content

Commit

Permalink
feat(shuttle): Pipe connectionTimeout arg through EventStreamHubSubsc…
Browse files Browse the repository at this point in the history
…riber (#2382)

## Why is this change needed?

Follow-up to #2367. I
missed piping through BaseHubSubscriber's new `connectionTimeout` param
through to EventStreamHubSubscriber, which means `connectionTimeout`
isn't really configurable for streaming right now like it should be.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [x] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on adding a new optional parameter, `connectionTimeout`,
to the `EventStreamHubSubscriber` class, allowing for better control
over connection timeouts.

### Detailed summary
- Added `connectionTimeout?: number` as an optional parameter in the
constructor of `EventStreamHubSubscriber`.
- Updated the call to `super` in the constructor to include the new
`connectionTimeout` argument.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
  • Loading branch information
tybook authored Oct 28, 2024
1 parent 5080bbb commit a9c45a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/itchy-feet-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@farcaster/shuttle": patch
---

feat(shuttle): Pipe connectionTimeout arg through EventStreamHubSubscriber
3 changes: 2 additions & 1 deletion packages/shuttle/src/shuttle/hubSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,10 @@ export class EventStreamHubSubscriber extends BaseHubSubscriber {
eventTypes?: HubEventType[],
totalShards?: number,
shardIndex?: number,
connectionTimeout?: number,
options?: EventStreamHubSubscriberOptions,
) {
super(label, hubClient.client, log, eventTypes, totalShards, shardIndex);
super(label, hubClient.client, log, eventTypes, totalShards, shardIndex, connectionTimeout);
this.eventStream = eventStream;
this.redis = redis;
this.streamKey = `hub:${hubClient.host}:evt:msg:${shardKey}`;
Expand Down

0 comments on commit a9c45a3

Please sign in to comment.