internal

package
v0.33.33 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadSubscription

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

ReadSubscription reads the messages coming in on the subscription and calls the given callback until the context of the subscription is cancelled.

func NewReadSubscription

func NewReadSubscription(sub p2p.Subscription, callback ReadSubscriptionCallBackFunction, log zerolog.Logger) *ReadSubscription

NewReadSubscription reads the messages coming in on the subscription

func (*ReadSubscription) ReceiveLoop

func (r *ReadSubscription) ReceiveLoop(ctx context.Context)

ReceiveLoop must be run in a goroutine. It continuously receives messages for the topic and calls the callback synchronously

type ReadSubscriptionCallBackFunction

type ReadSubscriptionCallBackFunction func(msg *message.Message, peerID peer.ID)

ReadSubscriptionCallBackFunction the callback called when a new message is received on the read subscription

Jump to

Keyboard shortcuts

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