synchronization

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrReceiveTimeout is returned when no message is received after a
	// specified duration in Receive
	ErrReceiveTimeout = errors.New("timeout waiting for message")
)

Functions

This section is empty.

Types

type StatsPusher

type StatsPusher struct {
	ORM      *orm.ORM
	WSClient WebSocketClient
	Period   time.Duration
	// contains filtered or unexported fields
}

StatsPusher polls for events and pushes them via a WebSocketClient

func NewStatsPusher

func NewStatsPusher(orm *orm.ORM, url *url.URL, accessKey, secret string, afters ...utils.Afterer) *StatsPusher

NewStatsPusher returns a new event queuer

func (*StatsPusher) Close

func (sp *StatsPusher) Close() error

Close shuts down the stats pusher

func (*StatsPusher) PushNow

func (sp *StatsPusher) PushNow()

PushNow wakes up the stats pusher, asking it to push all queued events immediately.

func (*StatsPusher) Start

func (sp *StatsPusher) Start() error

Start starts the stats pusher

type SyncJobRunPresenter

type SyncJobRunPresenter struct {
	*models.JobRun
}

SyncJobRunPresenter presents a JobRun for synchronization purposes

func (SyncJobRunPresenter) MarshalJSON

func (p SyncJobRunPresenter) MarshalJSON() ([]byte, error)

MarshalJSON returns the JobRun as JSON

type TxStatus

type TxStatus string

TxStatus indicates if a transaction is fulfiled or not

const (
	// StatusFulfilledRunLog indicates that a ChainlinkFulfilled event was
	// detected in the transaction receipt.
	StatusFulfilledRunLog TxStatus = "fulfilledRunLog"
	// StatusNoFulfilledRunLog indicates that no ChainlinkFulfilled events were
	// detected in the transaction receipt.
	StatusNoFulfilledRunLog = "noFulfilledRunLog"
)

type WebSocketClient

type WebSocketClient interface {
	Start() error
	Close() error
	Send([]byte)
	Receive(...time.Duration) ([]byte, error)
}

WebSocketClient encapsulates all the functionality needed to push run information to explorer.

func NewWebSocketClient

func NewWebSocketClient(url *url.URL, accessKey, secret string) WebSocketClient

NewWebSocketClient returns a stats pusher using a websocket for delivery.

Jump to

Keyboard shortcuts

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