lib

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

View Source
const CheckCamundaDuration = false
View Source
const DuplicateActivitySleep = 100 * time.Millisecond

Variables

View Source
var ErrMissingLastValue = errors.New("missing last value in mgw-last-value")
View Source
var ErrMissingLastValueCode = 513 //custom code to signify missing last-value in mgw-last-value

Functions

func GetCommandRequest

func GetCommandRequest(task messages.CamundaExternalTask) (command messages.Command, err error)

func StartCacheInvalidator

func StartCacheInvalidator(ctx context.Context, conf util.Config) (err error)

func StartHealthCheckEndpoint

func StartHealthCheckEndpoint(ctx context.Context, config util.Config, worker *CmdWorker)

func Worker

func Worker(ctx context.Context, config util.Config, comFactory com.FactoryInterface, repoFactory devicerepository.FactoryInterface, camundaFactory interfaces.FactoryInterface, marshallerFactory marshaller.FactoryInterface, timescaleFactory timescale.FactoryInterface)

Types

type CmdWorker

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

func New

func New(ctx context.Context, config util.Config, comFactory com.FactoryInterface, repoFactory devicerepository.FactoryInterface, camundaFactory interfaces.FactoryInterface, marshallerFactory marshaller.FactoryInterface, timescaleFactory timescale.FactoryInterface) (w *CmdWorker, err error)

func (*CmdWorker) CreateProtocolMessage

func (this *CmdWorker) CreateProtocolMessage(command messages.Command, task messages.CamundaExternalTask) (request *messages.KafkaMessage, event *messages.EventRequest, err error)

CreateProtocolMessage implements: devicegroups.Callback

func (*CmdWorker) ErrorMessageHandler

func (this *CmdWorker) ErrorMessageHandler(msg string) error

func (*CmdWorker) ExecuteCommand

func (this *CmdWorker) ExecuteCommand(command messages.Command, task messages.CamundaExternalTask, caller string)

func (*CmdWorker) ExecuteNextTasks

func (this *CmdWorker) ExecuteNextTasks() (wait bool)

func (*CmdWorker) ExecuteTask

func (this *CmdWorker) ExecuteTask(task messages.CamundaExternalTask, caller string)

func (*CmdWorker) GetLastEventValue

func (this *CmdWorker) GetLastEventValue(token string, userId string, device model.Device, service model.Service, protocol model.Protocol, characteristicId string, functionId string, aspect model.AspectNode, timeout time.Duration) (code int, result interface{})

func (*CmdWorker) GetQueuedResponseHandler

func (this *CmdWorker) GetQueuedResponseHandler(ctx context.Context, workerCount int64, queueSize int64) func(msg string) (err error)

func (*CmdWorker) GetState

func (this *CmdWorker) GetState() WorkerState

func (*CmdWorker) HandleTaskResponse

func (this *CmdWorker) HandleTaskResponse(msg string) (err error)

func (*CmdWorker) LastProducerCallSuccessful

func (this *CmdWorker) LastProducerCallSuccessful() bool

func (*CmdWorker) Loop

func (w *CmdWorker) Loop(ctx context.Context)

func (*CmdWorker) SinceLastSuccessfulCamundaCall

func (this *CmdWorker) SinceLastSuccessfulCamundaCall() time.Duration

type DeviceGroupsHandler

type DeviceGroupsHandler interface {
	ProcessCommand(request messages.Command, task messages.CamundaExternalTask, caller string) (completed bool, missingRequests messages.RequestInfoList, finishedResults []interface{}, err error)
	ProcessResponse(taskId string, subResult interface{}) (parent messages.GroupTaskMetadataElement, results []interface{}, finished bool, err error)
}

type Metrics

type Metrics interface {
	interfaces.Metrics
	HandleResponseTrace(trace []messages.Trace)
}

type Timescale

type Timescale interface {
	Query(token string, request []messages.TimescaleRequest, timeout time.Duration) (result []messages.TimescaleResponse, err error)
}

type WorkerState

type WorkerState struct {
	ProducerOk                bool
	LastSuccessfulCamundaCall time.Duration
}

Jump to

Keyboard shortcuts

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