mediator

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OpStatusNames = []string{"ok", "idle", "incomplete", "failed"}

	OpStatusFromName = map[string]OpStatus{
		"ok":         SYNC_OP_STATUS_OK,
		"idle":       SYNC_OP_STATUS_IDLE,
		"incomplete": SYNC_OP_STATUS_INCOMPLETE,
		"failed":     SYNC_OP_STATUS_FAILED,
	}
)

Functions

This section is empty.

Types

type OpMediator

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

func NewOpMediatorWithUniquenessControl

func NewOpMediatorWithUniquenessControl(ctx *sfPlugins.StatefunContextProcessor, uniqueIdGenerator func() string) (om *OpMediator, unque bool)

func (*OpMediator) AddIntermediateResult

func (om *OpMediator) AddIntermediateResult(ctx *sfPlugins.StatefunContextProcessor, intermediateResult *easyjson.JSON)

func (*OpMediator) AggregateOpMsg

func (om *OpMediator) AggregateOpMsg(som OpMsg) *OpMediator

func (*OpMediator) GetAggregatedOpMsgs

func (om *OpMediator) GetAggregatedOpMsgs() []OpMsg

func (*OpMediator) GetData

func (om *OpMediator) GetData() easyjson.JSON

func (*OpMediator) GetDetails

func (om *OpMediator) GetDetails() string

func (*OpMediator) GetLastSyncOp

func (om *OpMediator) GetLastSyncOp() OpMsg

func (*OpMediator) GetOpType

func (om *OpMediator) GetOpType() OpType

func (*OpMediator) GetStatus

func (om *OpMediator) GetStatus() OpStatus

func (*OpMediator) Reply

func (om *OpMediator) Reply()

func (*OpMediator) ReplyWithData

func (om *OpMediator) ReplyWithData(data *easyjson.JSON) error

func (*OpMediator) SignalWithAggregation

func (om *OpMediator) SignalWithAggregation(provider sfPlugins.SignalProvider, typename string, id string, payload *easyjson.JSON, options *easyjson.JSON) error

type OpMsg

type OpMsg struct {
	Status  OpStatus
	Details string
	Meta    string
	Data    easyjson.JSON
}

func MakeOpMsg

func MakeOpMsg(status OpStatus, details string, meta string, data easyjson.JSON) OpMsg

func OpMsgFailed

func OpMsgFailed(details string) OpMsg

func OpMsgFromJson

func OpMsgFromJson(reply *easyjson.JSON) OpMsg

func OpMsgFromSfReply

func OpMsgFromSfReply(reply *easyjson.JSON, err error) OpMsg

func OpMsgIdle

func OpMsgIdle(details string) OpMsg

func OpMsgIncomplete

func OpMsgIncomplete(details string) OpMsg

func OpMsgOk

func OpMsgOk(data easyjson.JSON) OpMsg

func (OpMsg) ToJson

func (som OpMsg) ToJson() *easyjson.JSON

type OpStatus

type OpStatus = int
const (
	SYNC_OP_STATUS_OK OpStatus = iota
	SYNC_OP_STATUS_IDLE
	SYNC_OP_STATUS_INCOMPLETE
	SYNC_OP_STATUS_FAILED
)

func GetSyncOpIntegratedStatusWithDefault

func GetSyncOpIntegratedStatusWithDefault(statuses []OpMsg, defaultStatus OpStatus) OpStatus

type OpType

type OpType = uint8
const (
	MereOp OpType = iota
	WorkerIsTaskedByAggregatorOp
	AggregatorRepliedByWorkerOp
	AggregatedWorkersOp
)

type SyncReplyPack

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

Jump to

Keyboard shortcuts

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