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

export close for flows that require reconnect semantics #17

Merged

Conversation

davidwalter0
Copy link
Collaborator

@davidwalter0 davidwalter0 commented Jan 24, 2019

standard flows monitoring a pulsar queue can probably dispense with accessing these apis, re-reading unacked messages is sufficient for restarting a read in 'normal' flows


// Close producer
func (m *ManagedProducer) Close(ctx context.Context) error {
return m.producer.Close(ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the managed producer's mutex be used for access to m.producer? Same comment for consumer code above.

Copy link
Collaborator Author

@davidwalter0 davidwalter0 Jan 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as suggested use the manager mutex.

add a monitor / deferrable acquire / release mutex

- pulsar unacknowledged reads initial reads work
- some unacknowledged subsequent reads fail
- some use cases cases invalidate queue connections
- deferrable lock release
@davidwalter0 davidwalter0 merged commit 644155c into Comcast:consumer/position Jan 25, 2019
davidwalter0 added a commit that referenced this pull request Jan 25, 2019
* Add ability to consume from beginning of topic

This allows for the `InitialPosition` field to be set when creating a
new subscriber. More tests should be added around this in the future.
For now, it's only available for "exclusive" consumers, but could be
added to other subscription types.

* expose options for re-reading unacked messages (#13)

* expose options for re-reading unacked messages

Signed-off-by: David Walter <davidwalter0@users.noreply.github.com>

* fix comment typos

Signed-off-by: David Walter <davidwalter0@users.noreply.github.com>

* Per review: prefer caller returns result directly

Signed-off-by: David Walter <davidwalter0@users.noreply.github.com>

* update comment wording

* add reconnect logic with unacknowledged reads (#17)

- pulsar unacknowledged reads initial reads work
- some unacknowledged subsequent reads fail
- some use cases cases invalidate queue connections
- deferrable lock release
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

Successfully merging this pull request may close these issues.

2 participants