Documentation
¶
Index ¶
- Variables
- func NewWorker(parentLogger logger.Logger, index int, runtime runtime.Runtime) (eventprocessor.EventProcessor, error)
- type Factory
- type Worker
- func (w *Worker) Continue() error
- func (w *Worker) Drain() error
- func (w *Worker) GetBinaryCloudEvent() *cloudevent.Binary
- func (w *Worker) GetEventTime() *time.Time
- func (w *Worker) GetIndex() int
- func (w *Worker) GetRuntime() runtime.Runtime
- func (w *Worker) GetStatistics() *eventprocessor.Statistics
- func (w *Worker) GetStatus() status.Status
- func (w *Worker) GetStructuredCloudEvent() *cloudevent.Structured
- func (w *Worker) ProcessEvent(event nuclio.Event, functionLogger logger.Logger) (interface{}, error)
- func (w *Worker) ProcessEventBatch(batch []nuclio.Event, functionLogger logger.Logger) ([]*runtime.ResponseWithErrors, error)
- func (w *Worker) ResetEventTime()
- func (w *Worker) Restart() error
- func (w *Worker) RunHandler()
- func (w *Worker) Stop() error
- func (w *Worker) Subscribe(kind controlcommunication.ControlMessageKind, ...) error
- func (w *Worker) SupportsRestart() bool
- func (w *Worker) Terminate() error
- func (w *Worker) Unsubscribe(kind controlcommunication.ControlMessageKind, ...) error
- func (w *Worker) WaitForStart()
Constants ¶
This section is empty.
Variables ¶
var WorkerFactorySingleton = Factory{}
global singleton
Functions ¶
func NewWorker ¶
func NewWorker(parentLogger logger.Logger, index int, runtime runtime.Runtime) (eventprocessor.EventProcessor, error)
NewWorker creates a new worker
Types ¶
type Factory ¶
type Factory struct{}
func (*Factory) CreateAsyncSingletonPoolWorkerAllocator ¶
func (waf *Factory) CreateAsyncSingletonPoolWorkerAllocator(logger logger.Logger, runtimeConfiguration *runtime.Configuration) (eventprocessor.Allocator, error)
func (*Factory) CreateFixedPoolWorkerAllocator ¶
func (waf *Factory) CreateFixedPoolWorkerAllocator(logger logger.Logger, numWorkers int, runtimeConfiguration *runtime.Configuration) (eventprocessor.Allocator, error)
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker holds all the required state and context to handle a single request
func (*Worker) GetBinaryCloudEvent ¶
func (w *Worker) GetBinaryCloudEvent() *cloudevent.Binary
GetBinaryCloudEvent return a binary cloud event
func (*Worker) GetEventTime ¶
GetEventTime return current event time, nil if we're not handling event
func (*Worker) GetRuntime ¶
GetRuntime returns the runtime of the worker, as specified during creation
func (*Worker) GetStatistics ¶
func (w *Worker) GetStatistics() *eventprocessor.Statistics
GetStatistics returns a pointer to the statistics object. This must not be modified by the reader
func (*Worker) GetStructuredCloudEvent ¶
func (w *Worker) GetStructuredCloudEvent() *cloudevent.Structured
GetStructuredCloudEvent return a structued clould event
func (*Worker) ProcessEvent ¶
func (w *Worker) ProcessEvent(event nuclio.Event, functionLogger logger.Logger) (interface{}, error)
ProcessEvent sends the event to the associated runtime
func (*Worker) ProcessEventBatch ¶
func (*Worker) ResetEventTime ¶
func (w *Worker) ResetEventTime()
ResetEventTime resets the event time
func (*Worker) RunHandler ¶
func (w *Worker) RunHandler()
func (*Worker) Subscribe ¶
func (w *Worker) Subscribe(kind controlcommunication.ControlMessageKind, channel chan *controlcommunication.ControlMessage) error
Subscribe subscribes to a control message kind
func (*Worker) SupportsRestart ¶
SupportsRestart returns true if the underlying runtime supports restart
func (*Worker) Unsubscribe ¶
func (w *Worker) Unsubscribe(kind controlcommunication.ControlMessageKind, channel chan *controlcommunication.ControlMessage) error
Unsubscribe unsubscribes from a control message kind
func (*Worker) WaitForStart ¶
func (w *Worker) WaitForStart()