work

package
v0.0.0-...-2a2c8f7 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WorkGenerate

func WorkGenerate(item *serializableModels.ClientRequest) (string, error)

func WorkToString

func WorkToString(w nanopow.Work) string

Types

type WorkProcessor

type WorkProcessor struct {
	Queue *models.RandomAccessQueue
	// WorkQueueChan is where we write requests from the websocket
	WorkQueueChan chan *serializableModels.ClientRequest
	// WorkProcessChan is where we actually read from the queue and compute work
	WorkProcessChan chan bool
	WSService       *websocket.WebsocketService
}

func NewWorkProcessor

func NewWorkProcessor(ws *websocket.WebsocketService, nWorkProcesses int) *WorkProcessor

func (*WorkProcessor) StartAsync

func (wp *WorkProcessor) StartAsync()

Start both workers

func (*WorkProcessor) StartRequestQueueWorker

func (wp *WorkProcessor) StartRequestQueueWorker()

RequestQueueWorker - is a worker that receives work requests directly from the websocket, adds them to the queue, and determines what should be worked on next

func (*WorkProcessor) StartWorkProcessor

func (wp *WorkProcessor) StartWorkProcessor()

WorkProcessor - is a worker that actually generates work and sends the result back over the websocket

Jump to

Keyboard shortcuts

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