processing

package
v0.0.0-...-eacd88d Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: GPL-3.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type HandleInput

type HandleInput func()

type HandleTimeout

type HandleTimeout func(int64)

type ITask

type ITask interface {
	HandleInput()
	HandleTimeout(timeoutId int64)
	UniqueId() int64
	EnqueuePacket(packet gopacket.Packet)
	DequeuePacket() gopacket.Packet
}

type Scheduler

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

func NewScheduler

func NewScheduler(workersCount int) *Scheduler

func (*Scheduler) AddTaskAction

func (self *Scheduler) AddTaskAction(taskAction TaskAction)

*

  • @brief Adds a taskAction to the Workers processing channel *
  • @param taskAction Action to be enqueued *

func (*Scheduler) Start

func (self *Scheduler) Start()

*

  • @brief Start the Scheduler Workers. Every Worker is a goroutine *

func (*Scheduler) Stop

func (self *Scheduler) Stop()

*

  • @brief Send the finish signal to the Workers and wait them
  • to finish gracefully

type SchedulerProcessor

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

type Task

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

func NewTask

func NewTask() *Task

func (*Task) DequeuePacket

func (self *Task) DequeuePacket() gopacket.Packet

func (*Task) EnqueuePacket

func (self *Task) EnqueuePacket(packet gopacket.Packet)

func (*Task) HandleInput

func (self *Task) HandleInput()

func (*Task) HandleTimeout

func (self *Task) HandleTimeout(timeoutId int64)

func (*Task) UniqueId

func (self *Task) UniqueId() int64

type TaskAction

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

func NewTaskAction

func NewTaskAction(task ITask) *TaskAction

func (*TaskAction) Execute

func (self *TaskAction) Execute()

func (*TaskAction) SetTimeoutId

func (self *TaskAction) SetTimeoutId(timeoutId int64)

func (*TaskAction) TimeoutId

func (self *TaskAction) TimeoutId() int64

type Worker

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

func NewWorker

func NewWorker(workerId int,
	waitGroup *sync.WaitGroup,
	taskActionChan chan TaskAction) *Worker

func (*Worker) Finish

func (self *Worker) Finish()

func (*Worker) Run

func (self *Worker) Run()

*

  • @brief { function_description } *
  • @return { description_of_the_return_value }

Jump to

Keyboard shortcuts

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