writer

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxWriterQueueSize max number of messages queued for broadcasting.
	MaxWriterQueueSize = 1000
)

Variables

This section is empty.

Functions

func NewBroadcast

NewBroadcast ...

func NewSendToMany

NewSendToMany ...

func NewSendToOne

NewSendToOne ...

Types

type Base

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

Base is base impl of a kadcast writer.

func (*Base) Close

func (b *Base) Close() error

Close unsubscribes.

func (*Base) Send

func (b *Base) Send(data []byte, addr string) error

Send is a wrapper of rusk.NetworkClient Send method.

type Broadcast

type Broadcast struct {
	Base
}

Broadcast is a proxy between EventBus and Kadcast service. It subscribes for both topics.Kadcast and topics.KadcastPoint, compiles a valid wire frame and propagates the message to Kadcast service.

func (*Broadcast) Subscribe

func (w *Broadcast) Subscribe()

Subscribe subscribes to eventbus Kadcast messages.

func (*Broadcast) Write

func (w *Broadcast) Write(data []byte, metadata *message.Metadata, priority byte) (int, error)

Write implements. ring.Writer.

type SendToMany

type SendToMany struct {
	Base
}

SendToMany collects topics.KadcastSendToMany event to distribute a single message to multiple nodes via rusk.NetworkClient Send call.

func (*SendToMany) Subscribe

func (w *SendToMany) Subscribe()

Subscribe subscribes to eventbus Kadcast messages.

func (*SendToMany) Write

func (w *SendToMany) Write(data []byte, metadata *message.Metadata, priority byte) (int, error)

Write ...

type SendToOne

type SendToOne struct {
	Base
}

SendToOne collects topics.KadcastSendToOne event to distribute a single message to a specified node via rusk.NetworkClient Send call.

func (*SendToOne) Subscribe

func (w *SendToOne) Subscribe()

Subscribe subscribes to eventbus Kadcast messages.

func (*SendToOne) Write

func (w *SendToOne) Write(data []byte, metadata *message.Metadata, priority byte) (int, error)

Write implements. ring.Writer.

Jump to

Keyboard shortcuts

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