Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrQueueFull is the error happens when the waiting queue is already full ErrQueueFull = errors.New("waiting request queue already full") // ErrClosed is request error that the module is closed during request ErrClosed = errors.New("request manager module closed") )
Functions ¶
This section is empty.
Types ¶
type RequestManager ¶
RequestManager manages over the requests
func NewRequestManager ¶
func NewRequestManager(sm streammanager.ReaderSubscriber) RequestManager
NewRequestManager creates a new request manager
type RequestOption ¶
type RequestOption func(*request)
RequestOption is the additional instruction for requests. Currently, two options are supported: 1. WithHighPriority 2. WithBlacklist 3. WithWhitelist
func WithBlacklist ¶
func WithBlacklist(blacklist []sttypes.StreamID) RequestOption
WithBlacklist is the request option not to assign the request to the blacklisted stream ID.
func WithHighPriority ¶
func WithHighPriority() RequestOption
WithHighPriority is the request option to do request with higher priority. High priority requests are done first.
func WithWhitelist ¶
func WithWhitelist(whitelist []sttypes.StreamID) RequestOption
WithWhitelist is the request option to restrict the request to be assigned to the given stream IDs. If a request is not with this option, all streams will be allowed.
Click to show internal directories.
Click to hide internal directories.