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:
Mamy Ratsimbazafy 2019-02-06 15:49:11 +01:00 committed by GitHub
parent 88933e8f1b
commit 9f15c6b752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 76 additions and 74 deletions

View File

@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier same "printed page" as the copyright notice for easier
identification within third-party archives. 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"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,6 +1,6 @@
The MIT License (MIT) 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -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) [![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) [![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: 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) [![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) ![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`: 1. Unified callback type `CallbackFunc`:
@ -40,7 +40,7 @@
3. Changed the behavior of OS descriptor event callbacks: 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. 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 * 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. 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]`. 13. Added cheap synchronization primitives: `AsyncLock`, `AsyncEvent`, and `AsyncQueue[T]`.
## Documentation ## 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 ## 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 ## TODO

View File

@ -1,11 +1,11 @@
# Asyncdispatch2 # Chronos
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2) # Apache License, version 2.0, (LICENSE-APACHEv2)
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import asyncdispatch2/[asyncloop, asyncfutures2, asyncsync, handles, transport, import chronos/[asyncloop, asyncfutures2, asyncsync, handles, transport,
timer] timer]
export asyncloop, asyncfutures2, asyncsync, handles, transport, timer export asyncloop, asyncfutures2, asyncsync, handles, transport, timer

View File

@ -1,9 +1,11 @@
packageName = "asyncdispatch2" packageName = "chronos"
version = "2.1.6" version = "2.2.0"
author = "Status Research & Development GmbH" author = "Status Research & Development GmbH"
description = "Asyncdispatch2" description = "Chronos"
license = "Apache License 2.0 or MIT" 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 ### Dependencies

View File

@ -1,8 +1,8 @@
# #
# Asyncdispatch2 # Chronos
# #
# (c) Coprygith 2015 Dominik Picheta # (c) Copyright 2015 Dominik Picheta
# (c) Copyright 2018 Status Research & Development GmbH # (c) Copyright 2018-Present Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2) # Apache License, version 2.0, (LICENSE-APACHEv2)

View File

@ -1,8 +1,8 @@
# #
# Asyncdispatch2 # Chronos
# #
# (c) Coprygith 2015 Dominik Picheta # (c) Copyright 2015 Dominik Picheta
# (c) Copyright 2018 Status Research & Development GmbH # (c) Copyright 2018-Present Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2) # Apache License, version 2.0, (LICENSE-APACHEv2)

View File

@ -1,8 +1,8 @@
# #
# Asyncdispatch2 synchronization primitives # Chronos synchronization primitives
# #
# (c) Coprygith 2018 Eugene Kabanov # (c) Copyright 2018-Present Eugene Kabanov
# (c) Copyright 2018 Status Research & Development GmbH # (c) Copyright 2018-Present Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2) # Apache License, version 2.0, (LICENSE-APACHEv2)

View File

@ -1,6 +1,6 @@
# #
# Asyncdispatch2 Handles # Chronos Handles
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of

View File

@ -1,6 +1,6 @@
# #
# Asyncdispatch2 SendFile # Chronos SendFile
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of

View File

@ -1,8 +1,8 @@
# #
# Asyncdispatch2 Timer # Chronos Timer
# #
# (c) Coprygith 2017 Eugene Kabanov # (c) Copyright 2017 Eugene Kabanov
# (c) Copyright 2018 Status Research & Development GmbH # (c) Copyright 2018-Present Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2) # Apache License, version 2.0, (LICENSE-APACHEv2)

View File

@ -1,6 +1,6 @@
# #
# Asyncdispatch2 Transport # Chronos Transport
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of

View File

@ -1,6 +1,6 @@
# #
# Asyncdispatch2 Transport Common Types # Chronos Transport Common Types
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of

View File

@ -1,6 +1,6 @@
# #
# Asyncdispatch2 Datagram Transport # Chronos Datagram Transport
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of

View File

@ -1,6 +1,6 @@
# #
# Asyncdispatch2 Stream Transport # Chronos Stream Transport
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import strutils, unittest import strutils, unittest
import ../asyncdispatch2 import ../chronos
when isMainModule: when isMainModule:
suite "TransportAddress test suite": suite "TransportAddress test suite":

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import unittest import unittest
import ../asyncdispatch2 import ../chronos
const HELLO_PORT = 45679 const HELLO_PORT = 45679
const TEST_MSG = "testmsg" const TEST_MSG = "testmsg"

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import strutils, net, unittest import strutils, net, unittest
import ../asyncdispatch2 import ../chronos
const const
TestsCount = 2000 TestsCount = 2000

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import unittest import unittest
import ../asyncdispatch2 import ../chronos
proc testFuture1(): Future[int] {.async.} = proc testFuture1(): Future[int] {.async.} =
await sleepAsync(100) await sleepAsync(100)

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import strutils, unittest import strutils, unittest
import ../asyncdispatch2 import ../chronos
type type
CustomServer = ref object of StreamServer CustomServer = ref object of StreamServer

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import unittest, strutils import unittest, strutils
import ../asyncdispatch2 import ../chronos
when not defined(windows): when not defined(windows):
import posix import posix

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import unittest import unittest
import ../asyncdispatch2 import ../chronos
const CallSoonTests = 10 const CallSoonTests = 10
var soonTest1 = 0'u var soonTest1 = 0'u

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import strutils, unittest, os import strutils, unittest, os
import ../asyncdispatch2 import ../chronos
when defined(windows): when defined(windows):
import winlean import winlean

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import unittest import unittest
import ../asyncdispatch2 import ../chronos
var testLockResult = "" var testLockResult = ""
var testEventResult = "" var testEventResult = ""

View File

@ -1,5 +1,5 @@
# Asyncdispatch2 Test Suite # Chronos Test Suite
# (c) Copyright 2018 # (c) Copyright 2018-Present
# Status Research & Development GmbH # Status Research & Development GmbH
# #
# Licensed under either of # Licensed under either of
@ -7,7 +7,7 @@
# MIT license (LICENSE-MIT) # MIT license (LICENSE-MIT)
import unittest import unittest
import ../asyncdispatch2, ../asyncdispatch2/timer import ../chronos, ../chronos/timer
const TimersCount = 10 const TimersCount = 10