rpcchainvm

package
v1.26.31 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: BSD-3-Clause Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory added in v0.1.1

func NewFactory(
	path string,
	processTracker resource.ProcessTracker,
	runtimeTracker runtime.Tracker,
	metricsGatherer metric.MultiGatherer,
) vms.Factory

NewFactory creates a new factory. VM subprocesses are spawned and communication uses ZAP — the one and only wire protocol for rpcchainvm.

Types

type Message added in v1.16.56

type Message uint32

Message represents a notification message type

const (

	// PendingTxs indicates pending transactions notification
	PendingTxs Message
)

func (Message) String added in v1.16.56

func (m Message) String() string

type NotificationForwarder added in v1.16.56

type NotificationForwarder struct {
	Engine    Notifier
	Subscribe Subscription
	Log       log.Logger
	// contains filtered or unexported fields
}

NotificationForwarder is a component that listens for notifications from a Subscription, and forwards them to a Notifier. When CheckForEvent is called mid-subscription, it retries the subscription. After Notify is called, it waits for CheckForEvent to be called before subscribing again.

func NewNotificationForwarder added in v1.16.56

func NewNotificationForwarder(
	engine Notifier,
	subscribe Subscription,
	log log.Logger,
) *NotificationForwarder

func (*NotificationForwarder) CheckForEvent added in v1.16.56

func (nf *NotificationForwarder) CheckForEvent()

CheckForEvent cancels any outstanding WaitForEvent calls and schedules a new WaitForEvent call.

func (*NotificationForwarder) Close added in v1.16.56

func (nf *NotificationForwarder) Close()

Close cancels any outstanding WaitForEvent calls and waits for them to return. After Close returns, no future WaitForEvent calls will be made by the notification forwarder.

type Notifier added in v1.16.56

type Notifier interface {
	Notify(context.Context, Message) error
}

type Subscription added in v1.16.56

type Subscription func(ctx context.Context) (Message, error)

Subscription is a function that blocks until either the given context is cancelled, or a message is returned. It is used to receive messages from a VM such as Pending transactions, state sync completion, etc. The function returns the message received, or an error if the context is cancelled.

Directories

Path Synopsis
Package commonmock is a generated GoMock package.
Package commonmock is a generated GoMock package.
Package sender provides p2p.Sender implementations over ZAP and gRPC transports.
Package sender provides p2p.Sender implementations over ZAP and gRPC transports.
Package zap provides ZAP transport implementation for VM RPC.
Package zap provides ZAP transport implementation for VM RPC.

Jump to

Keyboard shortcuts

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