Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TaskCodes ¶
func TaskCodes(sc TasksAndMetadataer) []serverutil.TaskCode
TaskCodes returns a slice of all assigned tasks codes. The task codes are sorted in assigned order, from oldest (at index 0) to most recent.
func WriteTaskID ¶
func WriteTaskID(w binaryutil.BasicWriter, id TaskID) error
WriteTaskID write the task ID (4 bytes; uint32) to the writer w.
Types ¶
type TaskID ¶
type TaskID uint32
TaskID is a four-byte value chosen by the client to identity tasks submitted to the server. It should be unique for all currently active tasks submitted by this client.
func ReadTaskID ¶
func ReadTaskID(r binaryutil.BasicReader) (TaskID, error)
ReadTaskID reads the task ID (4 bytes; uint32) from the reader r.
type TaskMetadata ¶
type TaskMetadata struct { ID TaskID // The task id Code serverutil.TaskCode // The task code Timestamp time.Time // The timestamp for this task }
TaskMetadata is the basic metadata associated with a task.
type TasksAndMetadataer ¶
type TasksAndMetadataer interface { Tasks() []TaskID // Tasks returns a slice of all assigned task ids. The ids are distinct, and sorted in increasing order. Metadata(id TaskID) *TaskMetadata // Metadata returns the metadata for the given task id, or nil if no currently assigned task has this id. }
TasksAndMetadataer is the interface satisfied by an object with both a Tasks and a Metadata method.
Directories ¶
Path | Synopsis |
---|---|
Package asyncserver provides the framework for an async server.
|
Package asyncserver provides the framework for an async server. |
Click to show internal directories.
Click to hide internal directories.