RepositoryNimCHSwitzerland
status-im

status-im/nim-chronos

Chronos - An efficient library for asynchronous programming

415stars
66forks
34issues
4views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: async

#1 Repository of the month

1
TINIX TRENDING·Topic: nim-language

#1 Repository of the month

1
TINIX TRENDING·Topic: nim

#1 Repository of the month

Chronos - An efficient library for asynchronous programming

Github action License: Apache License: MIT Stability: experimental

Introduction

Chronos is an efficient async/await framework for Nim. Features include:

  • Asynchronous socket and process I/O
  • HTTP 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
  • Exceptional error handling features, including raises tracking

Getting started

Install chronos using nimble:

nimble install chronos

or add a dependency to your .nimble file:

requires "chronos"

and start using it:

import chronos/apps/http/httpclient

proc retrievePage(uri: string): Future[string] {.async.} =
  # Create a new HTTP session
  let httpSession = HttpSessionRef.new()
  try:
    # Fetch page contents
    let resp = await httpSession.fetch(parseUri(uri))
    # Convert response to a string, assuming its encoding matches the terminal!
    bytesToString(resp.data)
  finally: # Close the session
    await httpSession.closeWait()

echo waitFor retrievePage(
  "https://raw.githubusercontent.com/status-im/nim-chronos/master/README.md")

Documentation

See the user guide.

Projects using chronos

  • libp2p - Peer-to-Peer networking stack implemented in many languages
  • presto - REST API framework
  • Scorper - Web framework
  • 2DeFi - Decentralised file system
  • websock - WebSocket library with lots of features

chronos is available in the Nim Playground

Submit a PR to add yours!

TODO

  • Multithreading Stream/Datagram servers

Contributing

When submitting pull requests, please add test cases for any new features or fixes and make sure nimble test is still able to execute the entire test suite successfully.

chronos follows the Status Nim Style Guide.

License

Licensed and distributed under either of

or

at your option. These files may not be copied, modified, or distributed except according to those terms.

Similar Projects

Discover other similar projects and AI models.

Repository
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

184.8k
Oct 31, 2026
RepositoryNim
ringabout/awesome-nim

A curated list of awesome Nim frameworks, libraries, software and resources.

1.6k
Oct 13, 2026
RepositoryNim
fox0430/moe

A command line based editor inspired by Vim. Written in Nim.

733
Nov 27, 2026
RepositoryNim
status-im/nimbus-eth1

Nimbus: an Ethereum Execution Client for Resource-Restricted Devices

637
Dec 2, 2026
RepositoryCython
MagicStack/uvloop

Ultra fast asyncio event loop.

11.9k
Nov 20, 2026
RepositoryPython
python-trio/trio

Trio – a friendly Python library for async concurrency and I/O

7.4k
Nov 24, 2026
RepositoryRust
async-rs/async-std

Async version of the Rust standard library

4.1k
Aug 15, 2025
RepositoryC++
lewissbaker/cppcoro

A library of C++ coroutine abstractions for the coroutines TS

3.9k
Jan 9, 2024
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026