event

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotRunning = errors.New("not running")

Functions

func MarketplaceTxHandler

func MarketplaceTxHandler(bus Bus) marketplace.Handler

func MarketplaceTxPublisher

func MarketplaceTxPublisher(ctx context.Context, log log.Logger, tmbus tmclient.EventsClient, bus Bus) (marketplace.Monitor, error)

Wrap tendermint event bus - publish events from tendermint bus to our bus implementation.

Types

type Bus

type Bus interface {
	Publish(Event) error
	Subscribe() (Subscriber, error)
	Close()
	Done() <-chan struct{}
}

Bus is an async event bus that allows subscriptions to behave as a bus themselves. When an event is published, it is sent to all subscribers asynchronously - a subscriber cannot block other subscribers.

NOTE: this should probably be in util/event or something (not in provider/event)

func NewBus

func NewBus() Bus

type ClusterDeployment added in v0.3.0

type ClusterDeployment struct {
	LeaseID types.LeaseID
	Group   *types.ManifestGroup
	Status  ClusterDeploymentStatus
}

type ClusterDeploymentStatus added in v0.3.0

type ClusterDeploymentStatus string
const (
	ClusterDeploymentPending  ClusterDeploymentStatus = "pending"
	ClusterDeploymentDeployed ClusterDeploymentStatus = "deployed"
)

type Event

type Event interface{}

type LeaseWon

type LeaseWon struct {
	LeaseID types.LeaseID
	Group   *types.DeploymentGroup
	Price   uint64
}

type ManifestReceived

type ManifestReceived struct {
	LeaseID    types.LeaseID
	Manifest   *types.Manifest
	Deployment *types.Deployment
	Group      *types.DeploymentGroup
}

func (ManifestReceived) ManifestGroup added in v0.0.9

func (ev ManifestReceived) ManifestGroup() *types.ManifestGroup

type Subscriber

type Subscriber interface {
	Events() <-chan Event
	Clone() (Subscriber, error)
	Close()
	Done() <-chan struct{}
}

Subscriber emits events it sees on the channel returned by Events(). A Clone() of a subscriber will emit all events that have not been emitted from the cloned subscriber. This is important so that events are not missed when adding subscribers for sub-components (see `provider/bidengine/{service,order}.go`)

type TxCloseDeployment

type TxCloseDeployment = types.TxCloseDeployment

type TxCloseFulfillment

type TxCloseFulfillment = types.TxCloseFulfillment

type TxCloseLease added in v0.2.4

type TxCloseLease = types.TxCloseLease

type TxCreateFulfillment

type TxCreateFulfillment = types.TxCreateFulfillment

type TxCreateLease

type TxCreateLease = types.TxCreateLease

type TxCreateOrder

type TxCreateOrder = types.TxCreateOrder

type TxUpdateDeployment added in v0.3.0

type TxUpdateDeployment = types.TxUpdateDeployment

Jump to

Keyboard shortcuts

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