2023-12-01 12:33:28 +01:00
|
|
|
# Examples
|
|
|
|
|
|
|
|
|
|
Examples are available in the [`docs/examples/`](https://github.com/status-im/nim-chronos/tree/master/docs/examples/) folder.
|
|
|
|
|
|
|
|
|
|
## Basic concepts
|
|
|
|
|
|
|
|
|
|
* [cancellation](https://github.com/status-im/nim-chronos/tree/master/docs/examples/cancellation.nim) - Cancellation primer
|
|
|
|
|
* [timeoutsimple](https://github.com/status-im/nim-chronos/tree/master/docs/examples/timeoutsimple.nim) - Simple timeouts
|
|
|
|
|
* [timeoutcomposed](https://github.com/status-im/nim-chronos/tree/master/docs/examples/examples/timeoutcomposed.nim) - Shared timeout of multiple tasks
|
|
|
|
|
|
2024-02-14 08:27:09 +01:00
|
|
|
## Threads
|
|
|
|
|
|
|
|
|
|
* [signalling](https://github.com/status-im/nim-chronos/tree/master/docs/examples/signalling.nim) - Cross-thread signalling
|
|
|
|
|
|
2023-12-01 12:33:28 +01:00
|
|
|
## TCP
|
|
|
|
|
|
|
|
|
|
* [tcpserver](https://github.com/status-im/nim-chronos/tree/master/docs/examples/tcpserver.nim) - Simple TCP/IP v4/v6 echo server
|
|
|
|
|
|
|
|
|
|
## HTTP
|
|
|
|
|
|
|
|
|
|
* [httpget](https://github.com/status-im/nim-chronos/tree/master/docs/examples/httpget.nim) - Downloading a web page using the http client
|
|
|
|
|
* [twogets](https://github.com/status-im/nim-chronos/tree/master/docs/examples/twogets.nim) - Download two pages concurrently
|
2024-01-12 15:39:45 +02:00
|
|
|
* [middleware](https://github.com/status-im/nim-chronos/tree/master/docs/examples/middleware.nim) - Deploy multiple HTTP server middlewares
|