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

Recreate event service if WithNoCache() opt used #225

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vadiminshakov
Copy link
Contributor

@vadiminshakov vadiminshakov commented Mar 4, 2022

This PR adds WithNoCache() func opt to the event client constructor to force reinitialization of event client instead of using an event client from cache.

Now two different event clients will be created with the same EventService if the same context.ChannelProvider (New(channelProvider context.ChannelProvider, opts ...ClientOption)) was passed. As a result, the passed functional options are ignored.

Example of undocumented behaviour:

eventClient1, err := event.New(chPrvdr, event.WithBlockEvents(), event.WithSeekType(seek.FromBlock), event.WithBlockNum(0))
...
eventClient2, err := event.New(chPrvdr, event.WithBlockEvents(), event.WithSeekType(seek.FromBlock), event.WithBlockNum(10))

eventClient2 will listen not from 10 block, but from 0. Expected behavior: the client will listen from the 10 block.

@vadiminshakov vadiminshakov requested a review from a team as a code owner March 4, 2022 09:48
Signed-off-by: Vadim Inshakov <[email protected]>
Signed-off-by: Vadim Inshakov <[email protected]>
Signed-off-by: Vadim Inshakov <[email protected]>
@stale
Copy link

stale bot commented Mar 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 30, 2022
@kopaygorodsky
Copy link
Contributor

kopaygorodsky commented Jul 24, 2022

It was fixed in #184

@stale stale bot removed the stale label Jul 24, 2022
@stale
Copy link

stale bot commented Jun 8, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants