Rebrand Asyncdispatch2 to Chronos [WIP] (#20)
* Update file headers, copyright date * Rename files and hopefully fix nimble * Forgot to change path in tests * Update readme
This commit is contained in:
parent
88933e8f1b
commit
9f15c6b752
|
@ -186,7 +186,7 @@
|
|||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2018 Status Research & Development GmbH
|
||||
Copyright 2018-Present Status Research & Development GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 Status Research & Development GmbH
|
||||
Copyright (c) 2018-Present Status Research & Development GmbH
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
14
README.md
14
README.md
|
@ -1,11 +1,11 @@
|
|||
# Asyncdispatch hard fork
|
||||
# Chronos - The Efficient Asynchronous library
|
||||
[![Build Status (Travis)](https://img.shields.io/travis/status-im/nim-asyncdispatch2/master.svg?label=Linux%20/%20macOS "Linux/macOS build status (Travis)")](https://travis-ci.org/status-im/nim-asyncdispatch2)
|
||||
[![Windows build status (Appveyor)](https://img.shields.io/appveyor/ci/nimbus/nim-asyncdispatch2/master.svg?label=Windows "Windows build status (Appveyor)")](https://ci.appveyor.com/project/nimbus/nim-asyncdispatch2)
|
||||
[![License: Apache](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
||||
![Stability: experimental](https://img.shields.io/badge/stability-experimental-orange.svg)
|
||||
|
||||
## Core differences between asyncdispatch and asyncdispatch2
|
||||
## Core differences between the standard library asyncdispatch and Chronos
|
||||
|
||||
1. Unified callback type `CallbackFunc`:
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
3. Changed the behavior of OS descriptor event callbacks:
|
||||
|
||||
For some unknown reason, the current version of asyncdispatch uses seq[T] to hold a list of descriptor event listeners. However, in the asynchronous environment, there is no need for a list of event listeners. In asyncdispatch2, there is only one place for one READ listener and one place for one WRITE listener.
|
||||
For some unknown reason, the current version of asyncdispatch uses seq[T] to hold a list of descriptor event listeners. However, in the asynchronous environment, there is no need for a list of event listeners. In Chronos, there is only one place for one READ listener and one place for one WRITE listener.
|
||||
|
||||
4. Removed the default timeout value for the poll() procedure, which allows incorrect usage of asyncdispatch and produces 500-ms timeouts in correct usage.
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
|||
* https://github.com/nim-lang/Nim/issues/6929
|
||||
|
||||
|
||||
6. Asyncdispatch2 no longer uses `epochTime()`; instead, it uses the fastest time primitives for a specific OS, `fastEpochTime()`. Also, because MacOS supports only a millisecond resolution in `kqueue`, sub-millisecond resolution is not needed. For details, see https://github.com/nim-lang/Nim/issues/3909.
|
||||
6. Chronos no longer uses `epochTime()`; instead, it uses the fastest time primitives for a specific OS, `fastEpochTime()`. Also, because MacOS supports only a millisecond resolution in `kqueue`, sub-millisecond resolution is not needed. For details, see https://github.com/nim-lang/Nim/issues/3909.
|
||||
|
||||
7. Removed all IO primitives (`recv()`, `recvFrom()`, `connect()`, `accept()`, `send()`, and `sendTo()`) from the public API, and moved all their functionality into Transports.
|
||||
|
||||
|
@ -70,13 +70,13 @@
|
|||
13. Added cheap synchronization primitives: `AsyncLock`, `AsyncEvent`, and `AsyncQueue[T]`.
|
||||
|
||||
## Documentation
|
||||
You can find more documentation, notes and examples in [Wiki](https://github.com/status-im/nim-asyncdispatch2/wiki).
|
||||
You can find more documentation, notes and examples in [Wiki](https://github.com/status-im/nim-chronos/wiki).
|
||||
|
||||
## Installation
|
||||
You can use Nim official package manager `nimble` to install `asyncdispatch2`. The most recent version of the library can be installed via:
|
||||
You can use Nim official package manager `nimble` to install `chronos`. The most recent version of the library can be installed via:
|
||||
|
||||
```
|
||||
$ nimble install https://github.com/status-im/nim-asyncdispatch2.git
|
||||
$ nimble install https://github.com/status-im/nim-chronos.git
|
||||
```
|
||||
|
||||
## TODO
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Asyncdispatch2
|
||||
# (c) Copyright 2018
|
||||
# Chronos
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
# Apache License, version 2.0, (LICENSE-APACHEv2)
|
||||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import asyncdispatch2/[asyncloop, asyncfutures2, asyncsync, handles, transport,
|
||||
import chronos/[asyncloop, asyncfutures2, asyncsync, handles, transport,
|
||||
timer]
|
||||
export asyncloop, asyncfutures2, asyncsync, handles, transport, timer
|
|
@ -1,9 +1,11 @@
|
|||
packageName = "asyncdispatch2"
|
||||
version = "2.1.6"
|
||||
packageName = "chronos"
|
||||
version = "2.2.0"
|
||||
author = "Status Research & Development GmbH"
|
||||
description = "Asyncdispatch2"
|
||||
description = "Chronos"
|
||||
license = "Apache License 2.0 or MIT"
|
||||
skipDirs = @["tests", "Nim", "nim", "benchmarks"]
|
||||
# workaround while chronos is still named asyncdispatch2 in Nimble
|
||||
srcDir = "chronos"
|
||||
# skipDirs = @["tests"]
|
||||
|
||||
### Dependencies
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
#
|
||||
# Asyncdispatch2
|
||||
# Chronos
|
||||
#
|
||||
# (c) Coprygith 2015 Dominik Picheta
|
||||
# (c) Copyright 2018 Status Research & Development GmbH
|
||||
# (c) Copyright 2015 Dominik Picheta
|
||||
# (c) Copyright 2018-Present Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
# Apache License, version 2.0, (LICENSE-APACHEv2)
|
|
@ -1,8 +1,8 @@
|
|||
#
|
||||
# Asyncdispatch2
|
||||
# Chronos
|
||||
#
|
||||
# (c) Coprygith 2015 Dominik Picheta
|
||||
# (c) Copyright 2018 Status Research & Development GmbH
|
||||
# (c) Copyright 2015 Dominik Picheta
|
||||
# (c) Copyright 2018-Present Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
# Apache License, version 2.0, (LICENSE-APACHEv2)
|
|
@ -1,8 +1,8 @@
|
|||
#
|
||||
# Asyncdispatch2 synchronization primitives
|
||||
# Chronos synchronization primitives
|
||||
#
|
||||
# (c) Coprygith 2018 Eugene Kabanov
|
||||
# (c) Copyright 2018 Status Research & Development GmbH
|
||||
# (c) Copyright 2018-Present Eugene Kabanov
|
||||
# (c) Copyright 2018-Present Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
# Apache License, version 2.0, (LICENSE-APACHEv2)
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Asyncdispatch2 Handles
|
||||
# (c) Copyright 2018
|
||||
# Chronos Handles
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Asyncdispatch2 SendFile
|
||||
# (c) Copyright 2018
|
||||
# Chronos SendFile
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
|
@ -1,8 +1,8 @@
|
|||
#
|
||||
# Asyncdispatch2 Timer
|
||||
# Chronos Timer
|
||||
#
|
||||
# (c) Coprygith 2017 Eugene Kabanov
|
||||
# (c) Copyright 2018 Status Research & Development GmbH
|
||||
# (c) Copyright 2017 Eugene Kabanov
|
||||
# (c) Copyright 2018-Present Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
# Apache License, version 2.0, (LICENSE-APACHEv2)
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Asyncdispatch2 Transport
|
||||
# (c) Copyright 2018
|
||||
# Chronos Transport
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Asyncdispatch2 Transport Common Types
|
||||
# (c) Copyright 2018
|
||||
# Chronos Transport Common Types
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Asyncdispatch2 Datagram Transport
|
||||
# (c) Copyright 2018
|
||||
# Chronos Datagram Transport
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Asyncdispatch2 Stream Transport
|
||||
# (c) Copyright 2018
|
||||
# Chronos Stream Transport
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import strutils, unittest
|
||||
import ../asyncdispatch2
|
||||
import ../chronos
|
||||
|
||||
when isMainModule:
|
||||
suite "TransportAddress test suite":
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import unittest
|
||||
import ../asyncdispatch2
|
||||
import ../chronos
|
||||
|
||||
const HELLO_PORT = 45679
|
||||
const TEST_MSG = "testmsg"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import strutils, net, unittest
|
||||
import ../asyncdispatch2
|
||||
import ../chronos
|
||||
|
||||
const
|
||||
TestsCount = 2000
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import unittest
|
||||
import ../asyncdispatch2
|
||||
import ../chronos
|
||||
|
||||
proc testFuture1(): Future[int] {.async.} =
|
||||
await sleepAsync(100)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import strutils, unittest
|
||||
import ../asyncdispatch2
|
||||
import ../chronos
|
||||
|
||||
type
|
||||
CustomServer = ref object of StreamServer
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import unittest, strutils
|
||||
import ../asyncdispatch2
|
||||
import ../chronos
|
||||
|
||||
when not defined(windows):
|
||||
import posix
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import unittest
|
||||
import ../asyncdispatch2
|
||||
import ../chronos
|
||||
|
||||
const CallSoonTests = 10
|
||||
var soonTest1 = 0'u
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import strutils, unittest, os
|
||||
import ../asyncdispatch2
|
||||
import ../chronos
|
||||
|
||||
when defined(windows):
|
||||
import winlean
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import unittest
|
||||
import ../asyncdispatch2
|
||||
import ../chronos
|
||||
|
||||
var testLockResult = ""
|
||||
var testEventResult = ""
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Asyncdispatch2 Test Suite
|
||||
# (c) Copyright 2018
|
||||
# Chronos Test Suite
|
||||
# (c) Copyright 2018-Present
|
||||
# Status Research & Development GmbH
|
||||
#
|
||||
# Licensed under either of
|
||||
|
@ -7,7 +7,7 @@
|
|||
# MIT license (LICENSE-MIT)
|
||||
|
||||
import unittest
|
||||
import ../asyncdispatch2, ../asyncdispatch2/timer
|
||||
import ../chronos, ../chronos/timer
|
||||
|
||||
const TimersCount = 10
|
||||
|
||||
|
|
Loading…
Reference in New Issue