Commit Graph

202 Commits

Author SHA1 Message Date
Dominik Picheta
9cc5927a99 [Backport] Fixes callbacks being dropped on Linux/macOS/BSD. (#15012)
Fixes #15003.

This is a serious bug which occurs when data cannot be read/sent
immediately and there are a bunch of other read/write events
pending. What happens is that the new events are dropped which
results in the case of the reported bug resulted in some data not
being sent (!).

(cherry picked from commit 1e3a0ef1e1)
2020-07-21 15:55:23 +02:00
slangmgh
6d5761d488 Fix #14289 (#14304) [backport]
(cherry picked from commit 76f7e95814)
2020-05-14 07:31:31 +02:00
alaviss
8cf8879941 asyncdispatch: export Callback (#14042) [backport]
This let us see the definition of `Callback` in docs, which is required
to even make use of asyncdispatch.

Ref #13539.

(cherry picked from commit 7beed44fc9)
2020-04-23 18:55:19 +02:00
narimiran
3009eafc89 [backport] run nimpretty on async
(cherry picked from commit aa513d78e7)
2019-09-30 18:43:35 +02:00
Federico Ceratto
fa7f5742d3 Fix spellings (#12277) [backport]
(cherry picked from commit 39290cf88c)
2019-09-30 18:43:35 +02:00
PMunch
2565d3d102 Fix issue with long wait for passed timer [bugfix] (#12221)
* Fix issue with long wait for passed timer [bugfix]

This fixes a small issue where a timer that had been completed while
code executed would still wait for more events before being considered
completed. This would in some scenarios incur a 500ms delay to the
completion of a timer.

* Refactor logic into

* Add test case based on original issue

* Use longer timeouts to be more lenient in checking

* Revert to short timeouts, but widen the accepted range

* Widen accepted range further, it is meant to check for a 500ms delay after all

* Increase poll timeout to make it easier to detect mistakes
2019-09-22 07:24:14 +02:00
Araq
908b553215 asyndispatch: removed deprecated setEvent proc 2019-09-21 06:43:37 +02:00
Oscar Nihlgård
1f32498a47 Use std/monotimes in the stdlib 2019-07-16 11:05:42 +02:00
Araq
bc7733827d make more parts of the stdlib compile with --styleCheck:error 2019-07-10 15:48:30 +02:00
Araq
c94647aeca styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error 2019-07-10 12:42:41 +02:00
Araq
7993d61d00 async: more 'owned' annotations 2019-07-09 11:38:00 +02:00
Andreas Rumpf
5f515410af newruntime for async (#11650)
* fixes overloading resolution for passing owned(Future[string]) to Future[T]
* WIP: make --newruntime work with .async
* memtracker: make it compile again
* make Nimble compile again
2019-07-05 01:42:17 +02:00
Dominik Picheta
73c44c6e9b [bugfix] Fixes async IO operations stalling even after socket is closed. (#11232) 2019-06-12 17:07:05 +02:00
LemonBoy
7d217a71d3 Render deprecated pragmas (#8886)
* Render deprecated pragmas
* fix the expected html
* clean up the documentation regarding deprecations
* fix typo
* fix system.nim
* fix random
2019-06-03 10:15:20 +02:00
Dominik Picheta
d0b8724aa2 Fixes crashes when asyncdispatch.adjustTimeout returns a negative value. (#11231) 2019-05-15 18:15:10 +02:00
Dominik Picheta
abe634aefe Implements pending future tracking in async. 2019-05-06 17:18:30 +01:00
Zed
3b4952da94 Fix header inconsistencies in documentation (#11071) 2019-04-23 08:40:20 +02:00
Zed
88079a0dee Documentation import fixes (#11070)
* Move asyncdispatch imports below introduction

* Move nre imports below documentation
2019-04-21 09:45:05 +02:00
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