package
Version:
v0.4.2
Opens a new window with list of versions in this module.
Published: Mar 17, 2022
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Option func(o *_Option)
Option : option function
WithSize setup max queue number of request queue
if max is 0, which means no limit
Q actor queue structure define
func (a *Q) AddPriorReq(req interface{}) error
AddPriorReq add normal request to the normal queue first place.
func (a *Q) AddReq(req interface{}) error
AddReq add normal request to the normal queue end place.
AddReqAnyway add normal request to the normal queue end place anyway
if queue full, sleep then try
func (a *Q) Pop() (interface{}, error)
Pop consume an item, if list is empty, it's been blocked
func (a *Q) PopAnyway() (interface{}, error)
PopAnyway consume an item like Pop, but it can consume even the queue is closed.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.