Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Any ¶
type Any struct {
// contains filtered or unexported fields
}
Any is used to execute batch tasks anf wait some tasks finish. It can't be reused.
func NewAnyWithParallel ¶
NewAnyWithParallel creates a batch to execute n tasks in max p goroutine and wait least tasks finish.
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
Batch is used to execute batch tasks. It can't be reused.
func NewBatchWithParallel ¶
NewBatchWithParallel creates a batch to execute n tasks in max p goroutine.
type G ¶
type G interface{}
G represents intefrace{}. Since Go has not implemented generic so we use it to mock generic.
type Stentor ¶
Stentor implments pub-sub pattern.
func (*Stentor) Unsubscribe ¶
Unsubscribe unsubscribes this Stentor.
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
Token is a token shared by n participants, and only one participant can do stuff at the same time. Participants must accquire the otoen before they do stuff. They will be blocked if the token by another participant. After a participant has finished its work, it can handoff the token to an determined participant.