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

client: redesign user API of Subscribe and SubscribeTo in pkg/varlog #655

Open
Tracked by #461
ijsong opened this issue Dec 5, 2023 · 0 comments
Open
Tracked by #461

Comments

@ijsong
Copy link
Member

ijsong commented Dec 5, 2023

Subscribe and SubscribeTo are similar, but their signatures differ, causing difficulty for users when using or refactoring their codes. Subscribe reads logs from a topic, while SubscribeTo reads logs from a log stream.

varlog/pkg/varlog/log.go

Lines 33 to 35 in 9e6713b

Subscribe(ctx context.Context, topicID types.TopicID, begin types.GLSN, end types.GLSN, onNextFunc OnNext, opts ...SubscribeOption) (SubscribeCloser, error)
SubscribeTo(ctx context.Context, topicID types.TopicID, logStreamID types.LogStreamID, begin, end types.LLSN, opts ...SubscribeOption) Subscriber

We need to redesign the APIs to ensure that they conform to each other. We could consider either push-based or pull-based scan APIs to achieve this. As of now, we do not have any concrete plans, so we are open to any designs.

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

No branches or pull requests

1 participant