pubsub

package
v1.5.0-preview.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataChannel

type DataChannel <-chan DataEvent

DataChannel is a channel which can accept an DataEvent

type DataEvent

type DataEvent struct {
	Data  interface{}
	Topic string
}

type PublishSubscriber

type PublishSubscriber struct {
	// contains filtered or unexported fields
}

PublishSubscriber stores the information about subscribers interested for a particular topic

func New

func New() *PublishSubscriber

func (*PublishSubscriber) Close

func (eb *PublishSubscriber) Close()

func (*PublishSubscriber) Publish

func (eb *PublishSubscriber) Publish(topic string, data interface{})

func (*PublishSubscriber) Subscribe

func (eb *PublishSubscriber) Subscribe(ctx context.Context, topic string) DataChannel

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL