Discover Packages
github.com/as-polyakov/minio
pkg
pubsub
package
Version:
v0.1.0-cvefix.2
Opens a new window with list of versions in this module.
Published: Aug 18, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
PubSub holds publishers and subscribers
New inits a PubSub system
NumSubscribers returns the number of current subscribers
func (ps *PubSub ) Publish(item interface{})
Publish message to the subscribers.
Note that publish is always nob-blocking send so that we don't block on slow receivers.
Hence receivers should use buffered channel so as not to miss the published events.
func (ps *PubSub ) Subscribe(subCh chan interface{}, doneCh <-chan struct{}, filter func(entry interface{}) bool )
Subscribe - Adds a subscriber to pubsub system
Source Files
¶
Click to show internal directories.
Click to hide internal directories.