core

package
v0.0.0-...-dac20d5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	// Start start the engine
	Start() error
	// Stop stop the engine
	Stop() error
	// StartInstance start instance, an instance may contain a lot of people,
	// so an instance will be divided into many shards, each shard handles some
	// people's events.
	StartInstance(workflow metapb.Workflow, loader metapb.BMLoader, crowd []byte) (uint64, error)
	// LastInstance returns last instance
	LastInstance(id uint64) (*metapb.WorkflowInstance, error)
	// HistoryInstance returens a workflow instance snapshot
	HistoryInstance(uint64, uint64) (*metapb.WorkflowInstanceSnapshot, error)
	// UpdateCrowd update instance crowd
	UpdateCrowd(id uint64, loader metapb.BMLoader, crowdMeta []byte) error
	// UpdateInstance update running workflow
	UpdateWorkflow(workflow metapb.Workflow) error
	// StopInstance stop instance
	StopInstance(id uint64) error
	// InstanceCountState returns instance count state
	InstanceCountState(id uint64) (metapb.InstanceCountState, error)
	// InstanceStepState returns instance step state
	InstanceStepState(id uint64, name string) (metapb.StepState, error)
	// TenantInit init tenant, and create the tenant input and output queue
	TenantInit(metapb.Tenant) error
	// Notifier returns notifier
	Notifier() notify.Notifier
	// Storage returns storage
	Storage() storage.Storage
	// Service returns a crm service
	Service() crm.Service
	// AddCronJob add cron job
	AddCronJob(string, func()) (cron.EntryID, error)
	// StopCronJob stop the cron job
	StopCronJob(cron.EntryID)
}

Engine the engine maintains all state information

func NewEngine

func NewEngine(store storage.Storage, notifier notify.Notifier, opts ...Option) (Engine, error)

NewEngine returns a engine

type Option

type Option func(*options)

Option engine option

func WithBitmapMaxCacheBytes

func WithBitmapMaxCacheBytes(value uint64) Option

WithBitmapMaxCacheBytes set bitmap max cache bytes option

func WithBitmapWorkers

func WithBitmapWorkers(value int) Option

WithBitmapWorkers set bitmap workers option

func WithClickhouse

func WithClickhouse(address, name, password string) Option

WithClickhouse set clickhouse option

func WithRetryOption

func WithRetryOption(value time.Duration) Option

WithRetryOption set retry option

func WithShardBitmapBytes

func WithShardBitmapBytes(value uint64) Option

WithShardBitmapBytes set bytes of shard bitmap option

func WithSnapshotTTL

func WithSnapshotTTL(value uint32) Option

WithSnapshotTTL set snapshot ttl option

func WithTempKeyTTL

func WithTempKeyTTL(value uint32) Option

WithTempKeyTTL set temp ttl option

func WithWorkerCreateCount

func WithWorkerCreateCount(value uint64) Option

WithWorkerCreateCount set worker create count option

Jump to

Keyboard shortcuts

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