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

internal/grpcsync: Provide an internal-only pub-sub type API #6167

Merged
merged 17 commits into from
Jun 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename OnChange to OnMessage
Co-authored-by: Easwar Swaminathan <[email protected]>
  • Loading branch information
my4-dev and easwars authored Apr 8, 2023
commit b6f28434519c360757b5f3396abd776c89d4e5f4
11 changes: 5 additions & 6 deletions internal/grpcsync/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 23,11 @@ import (
"sync"
)

// Watcher wraps the functionality to be implemented by components
// interested in watching msg changes.
type Watcher interface {
// OnChange is invoked to report msg changes on the
// entity being watched.
OnChange(msg interface{})
// Subscriber represents an entity that is subscribed to messages published on a PubSub.
// It wraps the callback to be invoked by the PubSub when a new message is published.
easwars marked this conversation as resolved.
Show resolved Hide resolved
type Subscriber interface {
// OnMessage is invoked to when a new message is published.
easwars marked this conversation as resolved.
Show resolved Hide resolved
OnMessage(msg interface{})
}

// PubSub is a simple one-to-many publish-subscribe system that supports messages
Expand Down