Commit Graph

160 Commits

Author SHA1 Message Date
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
Dominik Picheta
927fce4c7f FutureVar[T] parameters are now completed automatically. 2016-09-25 16:05:22 +02:00
Dominik Picheta
8a6343b5b6 Fixes #3847. 2016-09-25 13:02:10 +02:00
Dominik Picheta
dfe416eaad Fixes Futures' or operation so that asyncftpclient compiles. 2016-09-17 17:21:05 +02:00
Dominik Picheta
75e5c87f15 Fixes #4170. 2016-09-17 14:19:26 +02:00
Dominik Picheta
5bf16439e1 Fixes #4262. 2016-09-17 13:22:04 +02:00
Dmitry Polienko
d810b4515e Fix AsyncSocket send 2016-09-12 22:42:12 -07:00
Dominik Picheta
87eb3a105d Some small fixes to changes introduced by #4683. 2016-09-06 20:35:02 +02:00
Anatoly Galiulin
60dbfb2ec9 Revert function names scheme due to the @dom96 comment 2016-09-06 09:31:13 +07:00
Anatoly Galiulin
862d6ad234 Restore `recvInto` for backwards compatibility 2016-09-06 09:31:13 +07:00
Anatoly Galiulin
e4c46e6fba Add async IO operations with buffers on files and sockets 2016-09-06 09:31:13 +07:00
Eugene Kabanov
4fa3ded9c7 async: transfer all await/async macro related code to asyncmacro.nim module. (#4704)
* Transfer all async macro related code to asyncmacro.nim.

* Make tests green.
2016-09-03 20:52:45 +02:00
cheatfate
c5ffdd0389 Protect data argument for GC. 2016-08-30 23:15:08 +03:00
Andreas Rumpf
60b187513e stdlib and compiler don't use .immediate anymore 2016-07-29 23:51:01 +02:00
Andreas Rumpf
67b024838c fixes #1970 2016-07-19 20:44:08 +02:00
Andreas Rumpf
d83eb70643 async: use -d:nimDumpAsync to see what the async macro generates 2016-07-08 18:05:36 +02:00
Andreas Rumpf
b47d9b7b91 fixes #4371 2016-07-08 10:34:12 +02:00
Eduardo Bart
404b5b5ff4 Fix #4390 2016-06-21 19:42:42 -03:00
Eduardo Bart
c93292e2f7 Add withTimeout proc for futures 2016-06-19 12:56:37 -03:00
cheatfate
a93ae86088 Lets make arguments names equal on all platforms. 2016-06-17 13:44:28 +03:00
cheatfate
b53f13cbe7 New version, without any piece of code duplication. 2016-06-17 13:37:42 +03:00
Andreas Rumpf
9837b12ee6 Merge pull request #4336 from cheatfate/protectwinrw
Implement protection on callback environment.
2016-06-16 16:24:30 +02:00
Dominik Picheta
500aa0cb3f Reverts 1446dc87c3. Fixes #4333. Fixes #4170. 2016-06-15 16:56:28 +01:00
cheatfate
974dcc8766 One more place to release callback environment protection 2016-06-14 22:33:15 +03:00
cheatfate
11d9b15fc4 Implement protection on callback environment. 2016-06-14 21:23:48 +03:00