computations

package
v0.0.0-...-9bb8190 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartPlugin

func StartPlugin(impl ComputationImplementation)

StartPlugin starts serving RPC requests and brokers data between RPC caller and the computation

Types

type ComputationImplementation

type ComputationImplementation interface {
	GetInfo(definition string) (dagger.ComputationPluginInfo, error)
	SubmitRecord(t *dagger.Record) ([]*dagger.Record, error)
	GetState() ([]byte, error)
	SetState([]byte) error
}

ComputationImplementation represents a specific computation implementation

type ComputationPlugin

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

ComputationPlugin handles RPC calls from the main dagger process

func (*ComputationPlugin) GetInfo

func (p *ComputationPlugin) GetInfo(definition string, response *dagger.ComputationPluginInfo) error

GetInfo returns the inputs to this computation

func (*ComputationPlugin) GetState

func (p *ComputationPlugin) GetState(_ struct{},
	response *[]byte) error

GetState returns the dump of computation's state to dagger

func (*ComputationPlugin) SetState

func (p *ComputationPlugin) SetState(state []byte,
	response *string) error

SetState seeds the state of the computation

func (*ComputationPlugin) SubmitRecord

func (p *ComputationPlugin) SubmitRecord(t *dagger.Record,
	response *dagger.ComputationPluginResponse) error

SubmitRecord submits the record into processing

type TimeBucketsComputation

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

func NewTimeBucketsComputation

func NewTimeBucketsComputation(processor TimeBucketsProcessor) *TimeBucketsComputation

func (*TimeBucketsComputation) GetInfo

func (*TimeBucketsComputation) GetState

func (c *TimeBucketsComputation) GetState() ([]byte, error)

func (*TimeBucketsComputation) SetState

func (c *TimeBucketsComputation) SetState(state []byte) error

func (*TimeBucketsComputation) SubmitRecord

func (c *TimeBucketsComputation) SubmitRecord(t *dagger.Record) ([]*dagger.Record, error)

type TimeBucketsProcessor

type TimeBucketsProcessor interface {
	ProcessBucket(bucket dagger.Timestamp, t *dagger.Record) error
	FinalizeBucket(bucket dagger.Timestamp) *dagger.Record
	GetState() ([]byte, error)
	SetState([]byte) error
}

type TimeBucketsState

type TimeBucketsState struct {
	LastLWM        dagger.Timestamp `json:"last_lwm"`
	ProcessorState *json.RawMessage `json:"processor_state"`
}

Jump to

Keyboard shortcuts

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