Documentation
¶
Overview ¶
Package waitop provides wait for executing asynchronous operation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrAlreadyDoing indicates WaitOp is executing already. ErrAlreadyDoing = errors.New("already doing") // ErrTerminated indicates WaitOp have been closed without Fulfill() or // Rejected(). ErrTerminated = errors.New("terminated") // ErrNotDoing indicates asynchronous operation is not started yet. ErrNotDoing = errors.New("not started") )
Functions ¶
This section is empty.
Types ¶
type AsyncOp ¶
type AsyncOp func() error
AsyncOp starts asynchronous operation. When AsyncOp is finished Fulfill() or Reject() should be called.
type WaitOp ¶
type WaitOp struct {
// contains filtered or unexported fields
}
WaitOp provides wait for exclusive asynchronous operation.
func (*WaitOp) Close ¶
Close closes WaitOp. When executing WaitOp is closed, it returns ErrTerminated.
func (*WaitOp) Do ¶
Do starts asynchronous operation if it's not started yet. ErrAlreadyDoing and ErrTerminated will be retured.
Click to show internal directories.
Click to hide internal directories.