Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ticket ¶
type Ticket interface { // Take a ticket, if no tickets remain, then will be blocked. // if Ticket is closed, will return non-block. Take() // Return a ticket, if Ticket is closed, will return Return() // Remainder get the number of available tickets Remainder() int // Total is the total tickets Total() int // Close Ticket, Take() will get endless non-blocking tickets // return error, if Ticket has been closed Close() error // Reset will create new tickets Reset() }
Ticket represent limited resources to control concurrency
Click to show internal directories.
Click to hide internal directories.