Discover Packages
git.kescher.at/forestCloud/minio
pkg
pubsub
package
Version:
v0.0.0-...-d8f8204
Opens a new window with list of versions in this module.
Published: Jan 16, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 1
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
HasSubscribers returns true if pubsub system has 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.