Compile-time configuration options for chronos that control the availability of various strictness and debuggability options. In general, debug helpers are enabled when debug is defined while strictness options are introduced in transition periods leading up to a breaking release that starts enforcing them and removes the option.
chronosPreviewV4 is a preview flag to enable v4 semantics - in particular, it enables strict exception checking and disables parts of the deprecated API and other changes being prepared for the upcoming release
chronosDebug can be defined to enable several debugging helpers that come with a runtime cost - it is recommeneded to not enable these in production code.
In this file we also declare feature flags starting with chronosHas... - these constants are declared when a feature exists in a particular release - each flag is declared as an integer starting at 0 during experimental development, 1 when feature complete and higher numbers when significant functionality has been added. If a feature ends up being removed (or changed in a backwards-incompatible way), the feature flag will be removed or renamed also - you can use when declared(chronosHasXxx): when chronosHasXxx >= N: to require a particular version.
Consts
chronosDumpAsync: bool = false
- Print code generated by {.async.} transformation Source Edit
chronosEventEngine: string = ""
- OS polling engine type which is going to be used by chronos. Source Edit
chronosEventsCount = 64
- Number of OS poll events retrieved by syscall (epoll, kqueue, poll). Source Edit
chronosFutureId: bool = false
- Generate a unique id for every future - when disabled, the address of the future will be used instead Source Edit
chronosFutureTracking: bool = false
- Keep track of all pending futures and allow iterating over them - useful for detecting hung tasks Source Edit
chronosHandleException: bool = false
-
Remap Exception to AsyncExceptionError for all async functions.
This modes provides backwards compatibility when using functions with inaccurate {.raises.} effects such as unannotated forward declarations, methods and proc types - it is recommened to annotate such code explicitly as the Exception handling mode may introduce surprising behavior in exception handlers, should Exception actually be raised.
The setting provides the default for the per-function-based handleException parameter which has precedence over this global setting.
Exception handling may be removed in future chronos versions.
Source Edit chronosHasRaises = 0
- raises effect support via async: (raises: []) Source Edit
chronosInitialSize = 64
- Initial size of Selector[T]'s array of file descriptors. Source Edit
chronosProcShell: string = "/bin/sh"
-
Default shell binary path.
The shell is used as command for command line when process started using AsyncProcessOption.EvalCommand and API calls such as execCommand(command) and execCommandEx(command).
Source Edit chronosStackTrace: bool = false
- Include stack traces in futures for creation and completion points Source Edit
chronosStreamDefaultBufferSize = 16384
- Default size of chronos async stream internal buffer. Source Edit
chronosStrictFutureAccess: bool = false
- Source Edit
chronosTLSSessionCacheBufferSize = 4096
- Default size of chronos TLS Session cache's internal buffer. Source Edit
chronosTransportDefaultBufferSize = 16384
- Default size of chronos transport internal buffer. Source Edit
Templates
template chronosMoveSink(val: auto): untyped
- Source Edit