Help us shape the future of Go! Take the 2026 Go Developer Survey

subscription

package
v0.37.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const UnstakedRole = flow.Role(0)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelSubscriptionManager

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

ChannelSubscriptionManager manages subscriptions of engines running on the node to channels. Each channel should be taken by at most a single engine.

func NewChannelSubscriptionManager

func NewChannelSubscriptionManager(underlay network.Underlay) *ChannelSubscriptionManager

NewChannelSubscriptionManager creates a new subscription manager. Args: - networkUnderlay: the Underlay interface of the network layer. Returns: - a new subscription manager.

func (*ChannelSubscriptionManager) Channels

Channels returns all the channels registered in this subscription manager.

func (*ChannelSubscriptionManager) GetEngine

GetEngine returns engine associated with a channel.

func (*ChannelSubscriptionManager) Register

Register registers an engine on the channel into the subscription manager.

func (*ChannelSubscriptionManager) Unregister

func (sm *ChannelSubscriptionManager) Unregister(channel channels.Channel) error

Unregister removes the engine associated with a channel.

type RoleBasedFilter

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

RoleBasedFilter implements a subscription filter that filters subscriptions based on a node's role.

func NewRoleBasedFilter

func NewRoleBasedFilter(role flow.Role, idProvider module.IdentityProvider) *RoleBasedFilter

func (*RoleBasedFilter) CanSubscribe

func (f *RoleBasedFilter) CanSubscribe(topic string) bool

func (*RoleBasedFilter) FilterIncomingSubscriptions

func (f *RoleBasedFilter) FilterIncomingSubscriptions(from peer.ID, opts []*pb.RPC_SubOpts) ([]*pb.RPC_SubOpts, error)

Jump to

Keyboard shortcuts

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