Commit Graph

184 Commits

Author SHA1 Message Date
Andreas Rumpf
32c9ca605e fixes #10795 2019-03-06 10:15:27 +01:00
Miran
0ebfcd4c0f Remove deprecated modules (asyncio, sockets, ftpclient) (#10401) 2019-01-22 16:06:44 +01:00
Dominik Picheta
775bfb3e8d Merge async common into asyncdispatch. 2018-12-07 22:47:10 +00:00
Araq
3f6168b337 removes deprecated T/P types 2018-11-16 13:27:56 +01:00
narimiran
c2b16b46ec export asyncdispatch.callSoon (fixes #7192) 2018-11-12 15:40:33 +01:00
citycide
4362ba7293 docs: clarify asyncCheck vs waitFor 2018-10-27 18:04:25 +01:00
Andreas Rumpf
541debe6e1 stdlib: minor changes to avoid compiler warnings 2018-09-19 15:39:10 +02:00
Jedrzej Nowak
ac066c5db0 Handle fut.failed in asyncdispatch.WithTimeout
Fixes: #8839
2018-09-02 01:49:03 +02:00
Dominik Picheta
81f920a4ee Process timers before and after select. Fixes flaky #7758 test. (#8750) 2018-08-25 09:44:02 +02:00
Dominik Picheta
1b1633991a Don't skip poll() when no handles are present. (#8727)
Fixes #7886.

Fixes #7758.

Fixes #6929.

Fixes #3909.

Replaces #8209.
2018-08-23 20:35:22 +02:00
Ico Doornekamp
d6229f20ff Allow float argument to sleepAsync() to allow sub-millisecond resolution 2018-02-23 19:16:11 +01:00
Dominik Picheta
1a2351f95f Fixes #4995. (#7157) 2018-02-13 11:08:37 +01:00
Dominik Picheta
86fb8bf723 Revert 3db460f504 as requested by @Araq. 2018-01-28 17:13:08 +00:00
Dominik Picheta
47d05b3f2e Merge branch 'devel' into async-improvements 2018-01-17 16:28:00 +00:00
Ruslan Mustakov
3073f08e48 Add hasPendingOperations check to asyncdispatch.drain 2017-12-30 10:27:31 +01:00
Andreas Rumpf
0a3cd6d9ba fixes a serious poll() regression that caused poll() to ignore the timeout parameter 2017-12-28 19:54:55 +01:00
cheatfate
b22d9e4339 Fix #6906 2017-12-21 16:45:42 +02:00
Andreas Rumpf
85ac3130aa make asyncdispatch.poll completing all opterations that can be comple… (#6911)
introduce asyncdispatch.drain that completes all operations that can be completed immediately; implements #6523
2017-12-19 12:39:50 +01:00
Andreas Rumpf
5e43e0d789 Merge branch 'devel' into async-improvements 2017-12-11 15:12:45 +01:00
Mathias Stearn
b87ef65532 Use addCallback rather than callback= in asyncfutures.all() (#6850)
* Use addCallback rather than callback= in asyncfutures.all()

Addresses part of #6849

* Stop using do notation for #6849

* Update example style
2017-12-09 00:55:04 +00:00
Dominik Picheta
94fe5bd118 Fix asyncdispatch docgen 2017-11-26 18:14:30 +00:00
Dominik Picheta
325e4520ec Implements `asyncdispatch.getIoHandler` and assert on nil futures. 2017-11-24 16:30:56 +00:00
Dominik Picheta
3db460f504 The AsyncFD type now implies that the underlying FD is registered.
* `asyncdispatch.register` won't attempt to register an
  ``AsyncFD``, but instead assume that it is already registered.
2017-11-24 16:17:48 +00:00
Dominik Picheta
d3394be555 Async upcoming (#6585)
* Merge upcoming async with current.
* Various improvements to selectors (mostly docs).

Two changes to highlight:

* Renamed ``setEvent`` to ``trigger``
* Reused setBlocking from nativesockets.
* Various changes/fixes to asyncdispatch after upcoming merge.
* Make some attempts to be compatible with older selectors.
* Reuse epoll module in ioselectors_epoll.
2017-11-22 15:43:10 +01:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Michał Zieliński
cb5b1c9344 asyncdispatch: formatting fixes 2017-07-12 10:23:48 +02:00
Michał Zieliński
6bdd00db0e asyncdispatch: add callSoon getter/setter, renames 2017-07-06 13:27:42 +02:00
Michał Zieliński
93827e6ab8 split FutureStream from asyncfutures 2017-07-05 12:54:09 +02:00
Michał Zieliński
e86863e8f5 asyncdispatch: split asyncfutures into its own module
This slightly changes behaviour of callSoon - before loop is initialized, callSoon will call the function immediately.
2017-07-05 12:54:09 +02:00
Federico Ceratto
fcd86883ed Add waitFor on seq[Future], waitAll and more (#5189)
* Switch to unittest and speedup

* Make timers and callbacks fields public
2017-05-16 14:36:21 +01:00
Ruslan Mustakov
b826f85731 Remove unused oids import from asyncdispatch (#5811) 2017-05-14 15:07:33 +02:00
Christopher Dunn
2670a6f8a5 setGlobalDispatcher() 2017-05-07 22:07:07 -05:00
Ruslan Mustakov
ecf278c467 Implement dial, support IPv6 in httpclient (#5763)
* Implement dial, support IPv6 in httpclient

Added ``dial`` procedure to networking modules: ``net``, ``asyncdispatch``,
``asyncnet``. It merges socket creation, address resolution, and connection
into single step. When using ``dial``, you don't have to worry about
IPv4 vs IPv6 problem.

Fixed addrInfo loop in connect to behave properly.
Previously it would stop on first non-immediate failure, instead of
continuing and trying the remaining addresses.

Fixed newAsyncNativeSocket to raise proper error if socket creation
fails.

Fixes: #3811

* Check domain during connect() only on non-Windows

This is how it was in the previous implementation of connect().

* Call 'osLastError' before 'close' in net.dial

* Record osLastError before freeAddrInfo in net.dial

* Add missing docs for 'dial' proc

* Optimize dial to create one FD per domain, add tests

And make async IPv6 servers work on Windows.

* Add IPv6 test to uri module

* Fix getAddrString error handling
2017-05-02 09:25:50 +02:00
Andrey Sobolev
78de355ec6 Fix async timers execution. (#5448) 2017-03-01 09:43:24 +01:00
Dominik Picheta
f9cce32097 Various fixes to FutureStreams based on PR feedback. 2017-02-26 12:52:19 +01:00
Dominik Picheta
7766fdfec1 Implemented a first working version of FutureStreams. 2017-02-10 00:06:18 +01:00
Araq
8ae05c6555 cleaned up accept-close-race fix #5279 2017-02-07 14:59:46 +01:00
Ruslan Mustakov
fb8168d338 Fix Windows accept() to fail future instead of raising
Resolves: #5279
2017-02-01 18:18:44 +07:00
Andreas Rumpf
76eb20d2d3 deprecated nativesockets.dealloc, use freeAddrInfo instead; fixed stdlib deprecations 2017-01-30 08:50:57 +01:00
cheatfate
e84efc4d01 asyncdispatch exception memory leaks fixes. 2017-01-27 12:14:53 +02:00
Anatoly Galiulin
8e71949b78 Add pending operations presence check function, fixes #5155 2016-12-29 17:27:03 +07:00
cheatfate
d40b783110 Add comments to latest fixes.
One more fix.
Some artifacts removed.
2016-11-30 04:55:17 +02:00
Ruslan Mustakov
2c146445bc Added deques module, deprecating queues 2016-11-24 19:11:51 +07:00
Dominik Picheta
beb44ef13d Async: Refactors asyncdispatch.poll. 2016-11-19 20:21:52 +01:00
Dominik Picheta
ffbe7382f8 Async: Fixes problem when callbacks add other callbacks.
For context, see http://irclogs.nim-lang.org/19-11-2016.html#19:08:51
2016-11-19 20:16:15 +01:00
Dominik Picheta
d847d35009 Async: Further callbacks will no longer be called after an EAGAIN.
For context, see discussion here https://gitter.im/nim-lang/Nim?at=583090a2df9f0f6e7f576e43 or here http://irclogs.nim-lang.org/19-11-2016.html#17:30:59.
2016-11-19 20:06:23 +01:00
Federico Ceratto
7d24656b0a Fix few typos 2016-10-17 13:12:15 +01:00
cheatfate
0ff7fbea34 Fix handle of error only events. 2016-10-16 04:03:45 +03:00
Andreas Rumpf
21e35c201c made async compile again 2016-09-26 23:31:36 +02:00
Dominik Picheta
6aa8ff9af6 Moves async futures into asyncfutures module. 2016-09-25 18:24:35 +02:00