simulator

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackProxy

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

CallbackProxy is a proxy for a compute.Callback that can be used to send compute callbacks to the requester node, such as when the execution is completed or when a failure occurs. The proxy can forward callbacks to a remote requester node, or locally if the node is the requester and a LocalCallback is provided.

func NewCallbackProxy

func NewCallbackProxy(params CallbackProxyParams) *CallbackProxy

func (*CallbackProxy) OnBidComplete added in v0.3.26

func (p *CallbackProxy) OnBidComplete(ctx context.Context, result compute.BidResult)

func (*CallbackProxy) OnCancelComplete

func (p *CallbackProxy) OnCancelComplete(ctx context.Context, result compute.CancelResult)

func (*CallbackProxy) OnComputeFailure

func (p *CallbackProxy) OnComputeFailure(ctx context.Context, result compute.ComputeError)

func (*CallbackProxy) OnPublishComplete

func (p *CallbackProxy) OnPublishComplete(ctx context.Context, result compute.PublishResult)

func (*CallbackProxy) OnRunComplete

func (p *CallbackProxy) OnRunComplete(ctx context.Context, result compute.RunResult)

func (*CallbackProxy) RegisterLocalComputeCallback

func (p *CallbackProxy) RegisterLocalComputeCallback(callback compute.Callback)

type CallbackProxyParams

type CallbackProxyParams struct {
	SimulatorNodeID string
	Host            host.Host
	LocalCallback   compute.Callback
}

type ComputeProxy

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

ComputeProxy is a proxy to a compute node endpoint that will forward requests to remote compute nodes, or to a local compute node if the target peer ID is the same as the local host, and a LocalEndpoint implementation is provided.

func NewComputeProxy

func NewComputeProxy(params ComputeProxyParams) *ComputeProxy

func (*ComputeProxy) AskForBid

func (*ComputeProxy) BidAccepted

func (*ComputeProxy) BidRejected

func (*ComputeProxy) CancelExecution

func (*ComputeProxy) ExecutionLogs added in v0.3.26

func (*ComputeProxy) RegisterLocalComputeEndpoint

func (p *ComputeProxy) RegisterLocalComputeEndpoint(endpoint compute.Endpoint)

func (*ComputeProxy) ResultAccepted

func (*ComputeProxy) ResultRejected

type ComputeProxyParams

type ComputeProxyParams struct {
	SimulatorNodeID string
	Host            host.Host
	LocalEndpoint   compute.Endpoint // optional in case this host is also a compute node and to allow local calls

}

Jump to

Keyboard shortcuts

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