conduit

package
v0.29.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conduit

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

Conduit is a helper of the overlay layer which functions as an accessor for sending messages within a single engine process. It sends all messages to what can be considered a bus reserved for that specific engine.

func (*Conduit) Close

func (c *Conduit) Close() error

func (*Conduit) Multicast

func (c *Conduit) Multicast(event interface{}, num uint, targetIDs ...flow.Identifier) error

Multicast unreliably sends the specified event to the specified number of recipients selected from the specified subset. The recipients are selected randomly from targetIDs

func (*Conduit) Publish

func (c *Conduit) Publish(event interface{}, targetIDs ...flow.Identifier) error

Publish sends an event to the network layer for unreliable delivery to subscribers of the given event on the network layer. It uses a publish-subscribe layer and can thus not guarantee that the specified recipients received the event.

func (*Conduit) Unicast

func (c *Conduit) Unicast(event interface{}, targetID flow.Identifier) error

Unicast sends an event in a reliable way to the given recipient. It uses 1-1 direct messaging over the underlying network to deliver the event. It returns an error if the unicast fails.

type DefaultConduitFactory

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

DefaultConduitFactory is a wrapper around the network Adapter. It directly passes the incoming messages to the corresponding methods of the network Adapter.

func NewDefaultConduitFactory

func NewDefaultConduitFactory() *DefaultConduitFactory

func (*DefaultConduitFactory) NewConduit

func (d *DefaultConduitFactory) NewConduit(ctx context.Context, channel channels.Channel) (network.Conduit, error)

NewConduit creates a conduit on the specified channel. Prior to creating any conduit, the factory requires an Adapter to be registered with it.

func (*DefaultConduitFactory) RegisterAdapter

func (d *DefaultConduitFactory) RegisterAdapter(adapter network.Adapter) error

RegisterAdapter sets the Adapter component of the factory. The Adapter is a wrapper around the Network layer that only exposes the set of methods that are needed by a conduit.

Jump to

Keyboard shortcuts

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