nim-chronos/docs/src/introduction.md
Jacek Sieka 48b2b08cfb
Update docs (#480)
* new mdbook version with built-in Nim highlighting support
* describe examples in a dedicated page
* fixes
2023-12-01 12:33:28 +01:00

1.4 KiB

Introduction

Chronos implements the 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
  • HTTP client / server with SSL/TLS support out of the box (no OpenSSL needed)
  • Synchronization primitivies like queues, events and locks
  • Cancellation
  • Efficient dispatch pipeline with excellent multi-platform support
  • Exception effect support

Installation

Install chronos using nimble:

nimble install chronos

or add a dependency to your .nimble file:

requires "chronos"

and start using it:

{{#include ../examples/httpget.nim}}

There are more examples throughout the manual!

Platform support

Several platforms are supported, with different backend options:

  • Windows: IOCP
  • Linux: epoll / poll
  • OSX / BSD: kqueue / poll
  • Android / Emscripten / posix: poll

API documentation

This guide covers basic usage of chronos - for details, see the API reference.