Since 1.2acquireAcquires one permit from limiter.
The returned future resolves to true when a permit has been acquired. Call
Dex.Limiter.release exactly once for each resolved acquisition.
If the returned future is discarded before the permit is acquired, the permit
is returned to the limiter when it becomes available. If limiter is closed
before acquisition completes, the returned future rejects with
Dex.Error.SEMAPHORE_CLOSED.
a future that resolves when a permit is acquired
Since 1.2closeCloses limiter.
Pending and future acquisitions reject with Dex.Error.SEMAPHORE_CLOSED. Permits already acquired remain valid, but releasing them after close will not make them available for new work.
Since 1.2close_Closes limiter and waits for all queued and running work to complete.
After this function is called, new acquire attempts are rejected with Dex.Error.SEMAPHORE_CLOSED.
The returned future resolves to true once all outstanding pending acquire
futures and held permits are complete. Existing permit holders must still
eventually release.
a Dex.Future that resolves to true
SignalconnectSignalconnect_SignalemitSince 1.2get_Since 1.2releaseReleases one permit previously acquired from limiter.
This must be called exactly once for each successful Dex.Limiter.acquire unless the permit is managed by Dex.Limiter.run.
Since 1.2runRuns func while holding one permit from limiter.
The returned future resolves or rejects with the result of the spawned fiber. The permit is released automatically after the fiber resolves or rejects. If the returned future is discarded after the fiber starts, the fiber is allowed to complete so that the permit can be released.
a future representing the spawned fiber
Since 1.2run_Runs func while holding one permit from limiter.
The returned future resolves or rejects with the result of the spawned coroutine. The permit is released automatically after the coroutine resolves or rejects. If the returned future is discarded after the coroutine starts, the coroutine is allowed to complete so that the permit can be released.
scheduler to spawn func on, or null for the thread default
coroutine function to run after a permit is acquired
a future representing the spawned coroutine
Since 1.2run_Runs thread_func on pool while holding one permit from limiter.
The returned future resolves or rejects with the result of the submitted
thread-pool work. The permit is released automatically after the work
resolves or rejects. If the returned future is discarded after the work is
submitted to pool, the work is allowed to complete so that the permit can be
released.
Workers in Dex.ThreadPool are not scheduler threads, so thread_func must
not use dex_await().
function to run on pool after a permit is acquired
a future representing the submitted work
StaticnewReleases a reference on the given object, and decreases its reference count by one.
If it was the last reference, the resources associated to the instance are freed.
Dex.Limiter limits the number of operations running concurrently.
A limiter starts with a fixed number of permits. Use Dex.Limiter.acquire and Dex.Limiter.release directly when a permit must cover a custom scope, or use Dex.Limiter.run or Dex.Limiter.run_on_pool to acquire a permit and release it automatically when the work completes.
Since
1.2