handler

package
v0.0.0-...-318167e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	EventQueue []event.Event
	Timeout    int
	Scheduler  *gocron.Scheduler
	Lock       bool
}

func NewHandler

func NewHandler(timeout int) *Handler

NewHandler Creates a new Handler

func (*Handler) HandleEvents

func (h *Handler) HandleEvents()

HandleEvents Handle each type of event

func (*Handler) QueueEvent

func (h *Handler) QueueEvent(e event.Event)

func (*Handler) Run

func (h *Handler) Run()

Run Run the handling if the lock is available and the queue has events to process

func (*Handler) SendEvent

func (h *Handler) SendEvent()

func (*Handler) StartHandlingEvents

func (h *Handler) StartHandlingEvents()

StartHandlingEvents Start the process of handling events, aka run the scheduler

func (*Handler) StopHandlingEvents

func (h *Handler) StopHandlingEvents()

StopHandlingEvents Stop the handling process

Jump to

Keyboard shortcuts

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