* Update mdbook-open-on-gh version.
2.4.1 would crash during build locally.
* Fix path to async_procs.md.
* Add the guide to update the book.
---------
Co-authored-by: Jacek Sieka <jacek@status.im>
* Fix original TokenBucket, consolidate the behaviors of chronos/TokenBucket and waku/TokenBucket (compensating) with no interface change
* TokenBucket extended with waku's strict mode replenish, that does not allow refill just after period boundary elapsed.
* Adjust for new chat-sdk needs, added setState and getAvailableCapacity with small refactoring
* Better comments
* rename for better self explain code, added more explanatory comments upon code review finding
* Document TokenBucket with detailed samples of Balanced mode replenishment algorithm, extended TokenBucket unit test
* Address review comments, renaming the replenish modes, removed old/new algo comparison from documentation, fix Discrete mode update calculation to properly calculate correct last update time by period distance calculation.
* protect from devide by zero, code style fix
* Make (re)setState close pending request before reseting state
* Polishing interface, move discrete mode initial start time setup into ctor and remove resetState to have a cleaner and consistent interface for both usage mode
* Addressing review observation, keep only singel new ctor and leave defaults to match former use.
* Removing leftovers and confirm with coding guideline
* refactor rate limiter implementation
* make sure that `tryConsume` respects queued `consume` requests
* refill tokens the same way regardless of replenish mode and source of
tokens (manual/time-based/cancellation)
* whem manually replenishing, compute budget cap after satisfying queued
requests
* don't run worker if fill duration is 0
* add some docs
* int vs int64
* Fix Discrete mode time window drift, added tests
* wait for sleeper/waiter
---------
Co-authored-by: Jacek Sieka <jacek@status.im>
* add missing calls to await
* add test run in v3 compatibility
* fix semantics for chronosHandleException so it does not override local raises/handleException annotations
* distinguish between explicit override and default setting; fix test
* re-enable wrongly disabled check
* make implementation simpler/clearer
* update docs
* reflow long line
* word swap
Dedicated exceptions for `read` failures reduce the risk of mixing up
"user" exceptions with those of Future itself. The risk still exists, if
the user allows a chronos exception to bubble up explicitly.
Because `await` structurally guarantees that the Future is not `pending`
at the time of `read`, it does not raise this new exception.
* introduce `FuturePendingError` and `FutureCompletedError` when
`read`:ing a future of uncertain state
* fix `waitFor` / `read` to return `lent` values
* simplify code generation for `void`-returning async procs
* document `Raising` type helper
* introduce user guide based on `mdbook`
* set up structure for adding simple `chronos` usage examples
* move most readme content to book
* ci deploys book and api guide automatically
* remove most of existing engine docs (obsolete)