Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Size of incoming requests buffer InBufSize = 1 // Size of packed threads buffer OutBufSize = 1 )
Functions ¶
func NewFFQueue ¶
func NewFFQueue( ctx context.Context, pollInterval time.Duration, spawnDeadline time.Duration, ) *ffQueue
Fair FIFO-queue with isolated per-peer processing and adaptive invocation rate. Queue is polled with specified frequency and every scheduled call expected to be spawned until its deadline. At every moment only one call for the peer/thread pair exists in the queue. Scheduled operations could be replaced with a new ones based on the priority value (new higher-priority call replaces waiting one).
Types ¶
type ThreadPacker ¶
type ThreadPacker interface { // Add thread to peer's queue Add(pid peer.ID, tid thread.ID) // Start packing incoming thread requests Run() <-chan ThreadPack }
Click to show internal directories.
Click to hide internal directories.