subscription

package
v0.37.21 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: AGPL-3.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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