2023-11-15 09:06:37 +01:00
|
|
|
# Introduction
|
|
|
|
|
|
|
|
|
|
Chronos implements the [async/await](https://en.wikipedia.org/wiki/Async/await)
|
|
|
|
|
paradigm in a self-contained library using macro and closure iterator
|
|
|
|
|
transformation features provided by Nim.
|
|
|
|
|
|
|
|
|
|
Features include:
|
|
|
|
|
|
|
|
|
|
* Asynchronous socket and process I/O
|
2023-12-01 12:33:28 +01:00
|
|
|
* HTTP client / server with SSL/TLS support out of the box (no OpenSSL needed)
|
2023-11-15 09:06:37 +01:00
|
|
|
* Synchronization primitivies like queues, events and locks
|
2023-12-01 12:33:28 +01:00
|
|
|
* [Cancellation](./concepts.md#cancellation)
|
2023-11-15 09:06:37 +01:00
|
|
|
* Efficient dispatch pipeline with excellent multi-platform support
|
|
|
|
|
* Exception [effect support](./guide.md#error-handling)
|
|
|
|
|
|
2023-12-01 12:33:28 +01:00
|
|
|
## Installation
|
|
|
|
|
|
|
|
|
|
Install `chronos` using `nimble`:
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
nimble install chronos
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
or add a dependency to your `.nimble` file:
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
requires "chronos"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
and start using it:
|
|
|
|
|
|
|
|
|
|
```nim
|
|
|
|
|
{{#include ../examples/httpget.nim}}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
There are more [examples](./examples.md) throughout the manual!
|
|
|
|
|
|
2023-11-15 09:06:37 +01:00
|
|
|
## Platform support
|
|
|
|
|
|
|
|
|
|
Several platforms are supported, with different backend [options](./concepts.md#compile-time-configuration):
|
|
|
|
|
|
|
|
|
|
* Windows: [`IOCP`](https://learn.microsoft.com/en-us/windows/win32/fileio/i-o-completion-ports)
|
|
|
|
|
* Linux: [`epoll`](https://en.wikipedia.org/wiki/Epoll) / `poll`
|
|
|
|
|
* OSX / BSD: [`kqueue`](https://en.wikipedia.org/wiki/Kqueue) / `poll`
|
|
|
|
|
* Android / Emscripten / posix: `poll`
|
|
|
|
|
|
|
|
|
|
## API documentation
|
|
|
|
|
|
|
|
|
|
This guide covers basic usage of chronos - for details, see the
|
|
|
|
|
[API reference](./api/chronos.html).
|