Module: Async::Limiter::Timing::None
- Defined in:
- lib/async/limiter/timing/none.rb
Overview
No timing constraints - tasks can execute immediately.
This strategy provides no time-based limiting, suitable for pure concurrency control without rate limiting.
Class Method Summary collapse
-
.acquire(cost = 1) ⇒ Object
Record that a task was acquired (no-op for this strategy).
-
.can_acquire?(cost = 1) ⇒ Boolean
Check if a task can be acquired (always true for no timing constraints).
-
.maximum_cost ⇒ Object
Maximum cost this timing strategy can support (unlimited for no constraints).
-
.statistics ⇒ Object
Get current timing strategy statistics.
-
.wait(mutex, deadline = nil, cost = 1) ⇒ Object
Wait for timing constraints to be satisfied (no-op for this strategy).
Class Method Details
.acquire(cost = 1) ⇒ Object
Record that a task was acquired (no-op for this strategy).
32 33 34 |
# File 'lib/async/limiter/timing/none.rb', line 32 def self.acquire(cost = 1) # No state to update end |
.can_acquire?(cost = 1) ⇒ Boolean
Check if a task can be acquired (always true for no timing constraints).
26 27 28 |
# File 'lib/async/limiter/timing/none.rb', line 26 def self.can_acquire?(cost = 1) true end |
.maximum_cost ⇒ Object
Maximum cost this timing strategy can support (unlimited for no constraints).
20 21 22 |
# File 'lib/async/limiter/timing/none.rb', line 20 def self.maximum_cost Float::INFINITY end |
.statistics ⇒ Object
Get current timing strategy statistics.
48 49 50 51 52 |
# File 'lib/async/limiter/timing/none.rb', line 48 def self.statistics { name: "None" } end |
.wait(mutex, deadline = nil, cost = 1) ⇒ Object
Wait for timing constraints to be satisfied (no-op for this strategy).
41 42 43 44 |
# File 'lib/async/limiter/timing/none.rb', line 41 def self.wait(mutex, deadline = nil, cost = 1) # No waiting needed - return immediately true end |