asyncclientutil

package
v0.0.0-...-7847555 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: CC0-1.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SimpleSend

SimpleSend attempts to send the task code t and message data r to the server sc. This is suitable for use if no response data is expected.

Types

type Task

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

Task represents a task submitted to the server. A Task should not be used when receiving large amounts of response data from the server, since the data is cached in the Task.

func Send

Send submits the indicated task, with given data r, to the server sc. If no data needs to be sent, you may set r equal to nil.

func (*Task) Done

func (ts *Task) Done() <-chan struct{}

Done returns the done channel for this task. The channel will be closed when a response has been returned by the server.

func (*Task) ID

func (ts *Task) ID() async.TaskID

ID returns the task ID.

func (*Task) Log

func (ts *Task) Log() log.Interface

Log returns a logger for this task.

func (*Task) Metadata

func (ts *Task) Metadata() *async.TaskMetadata

Metadata returns the metadata for the task.

func (*Task) Response

func (ts *Task) Response() (*asyncclient.Response, error)

Response returns the response received from the server. This will block until the ts.Done() channel is closed.

func (*Task) ResponseData

func (ts *Task) ResponseData() (binaryutil.BinaryReader, error)

ResponseData returns a binaryutil.BinaryReader containing any response data received from the server. This data is cached on the task, so each call to ResponseData returns a new reader. This will block until the ts.Done() channel is closed.

Jump to

Keyboard shortcuts

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