Skip to content

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

Open
@ijsong

Description

@ijsong

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions