consumer

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const NexusName = "ConsumerNexus"

NexusName is the name of the consumer nexus.

Variables

This section is empty.

Functions

This section is empty.

Types

type FinishedCb added in v0.54.0

type FinishedCb func(consumerNexus Nexus)

FinishedCb is a callback for when the Nexus finishes.

type Nexus added in v0.54.0

type Nexus struct {
	*base.NexusBase
	// contains filtered or unexported fields
}

Nexus is a consumer nexus to manage websockets as a consumer of the protocol.

func NewConsumerNexus

func NewConsumerNexus(belowNexus nexus.Nexus) *Nexus

NewConsumerNexus creates a new consumer nexus.

func (*Nexus) ConsumerFinishedCb added in v0.54.0

func (c *Nexus) ConsumerFinishedCb()

ConsumerFinishedCb is wether or not the consumer callback is finished.

func (*Nexus) IsLayerMessage added in v0.54.0

func (c *Nexus) IsLayerMessage(message base2.MoneysocketMessage) bool

IsLayerMessage determines whether or not a message should be processed by this layer.

func (*Nexus) OnBinMessage added in v0.54.0

func (c *Nexus) OnBinMessage(belowNexus nexus.Nexus, msg []byte)

OnBinMessage processes a binary message.

func (*Nexus) OnMessage added in v0.54.0

func (c *Nexus) OnMessage(belowNexus nexus.Nexus, msg base2.MoneysocketMessage)

OnMessage processes a passed message.

func (*Nexus) OnPing added in v0.54.0

func (c *Nexus) OnPing(consumerNexus nexus.Nexus, milliseconds int)

OnPing calls the onPing method passed to the Nexus.

func (*Nexus) SendPing added in v0.54.0

func (c *Nexus) SendPing()

SendPing sends a ping up the nexus chain.

func (*Nexus) SetOnPing added in v0.54.0

func (c *Nexus) SetOnPing(fn OnPingFn)

SetOnPing sets the ping function.

func (*Nexus) StartHandshake added in v0.54.0

func (c *Nexus) StartHandshake(cb FinishedCb)

StartHandshake starts a handshake/sets a finished callback.

func (*Nexus) StartPinging added in v0.54.0

func (c *Nexus) StartPinging()

StartPinging on a set interval.

func (*Nexus) StopPinging added in v0.54.0

func (c *Nexus) StopPinging()

StopPinging stops the consumer from pinging.

type OnPingFn

type OnPingFn func(nexus nexus.Nexus, msecs int)

OnPingFn is a function to trigger a ping on an given interval announcing to a passed in nexus.

Jump to

Keyboard shortcuts

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