summary refs log tree commit diff stats
path: root/lib/pure/asyncdispatch.nim
Commit message (Collapse)AuthorAgeFilesLines
* Fix OSError `errorCode` field is not assigned a value (#22954)握猫猫2023-11-171-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | In this PR, the following changes were made: 1. Replaced `raise newException(OSError, osErrorMsg(errno))` in batches with `raiseOSError(errcode)`. 2. Replaced `newException(OSError, osErrorMsg(errno))` in batches with `newOSError(errcode)`. There are still some places that have not been replaced. After checking, they are not system errors in the traditional sense. ```nim proc dlclose(lib: LibHandle) = raise newException(OSError, "dlclose not implemented on Nintendo Switch!") ``` ```nim if not fileExists(result) and not dirExists(result): # consider using: `raiseOSError(osLastError(), result)` raise newException(OSError, "file '" & result & "' does not exist") ``` ```nim proc paramStr*(i: int): string = raise newException(OSError, "paramStr is not implemented on Genode") ```
* complete std prefixes for stdlib (#22887)ringabout2023-10-301-10/+10
| | | | follow up https://github.com/nim-lang/Nim/pull/22851 follow up https://github.com/nim-lang/Nim/pull/22873
* fix build on haiku (#21752)Al Hoang2023-04-291-1/+1
| | | * missing maxDescriptors
* asyncdispatch: for NuttX, add destructor to clear global dispatcher. (#21432)Century Systems2023-02-281-1/+12
| | | | | | | | | | | | | * asyncdispatch: for NuttX, add destructor to clear global dispatcher using atexit(). Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> * std: exitprocs: remove "when defined(nuttx)" block. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> --------- Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
* NuttX added supports getrlimit(RLIMIT_NOFILE), so remove NuttX specific ↵Century Systems2023-02-211-3/+0
| | | | | | | codes. (#21385) async: NuttX added supports getrlimit(RLIMIT_NOFILE), so remove NuttX-specific codes. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
* Add support for NuttX RTOS. (#21372)Century Systems2023-02-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | * Add support for NuttX RTOS. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> * lib: pure: asyncdispatch: assign to result. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> * lib: std: typedthreads: add support for parameters to adjust Thread Stack Size. Like FreeRTOS/Zephyr, add support for following configurations. -d:nimThreadStackSize=xxxxx -d:nimThreadStackGuard=yyyy Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> --------- Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
* stdlib organization & documentation improvements (#20971)metagn2022-12-061-1/+2
| | | | | | | | | | | | | | | | | * stdlib organization & documentation improvements * fix CI * Update doc/lib.md Co-authored-by: Juan Carlos <juancarlospaco@gmail.com> * fix ci, remove jshttpcore, export in jsfetch instead * fix alphabetical order violations * add cmdline, db_odbc Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
* change `include genode/env` to an import (#20721)ringabout2022-11-011-1/+1
| | | | | | | * change `include genode/env` to an import ref https://github.com/nim-lang/Nim/commit/0b262e9496387d5e8adc0c5f6020b3f3300e8f79#diff-8718bd20d8f61d6638d3d64b19efc31bcd40a6d5be8215b2a1f0b75ed93e8d56 * fixes comments
* Genode: add scheduleCallbacks to asyncdispatch (#20708)ehmry2022-10-311-3/+29
| | | | | | | | | * Genode: add native signal handler * Genode: add scheduleCallbacks to asyncdispatch This resolves some awkwardness where an RPC server may or may not use callSoon while dispatching RPC but without scheduling timers or I/O.
* Markdown code blocks migration part 7 (#20547)Andrey Makarov2022-10-121-12/+12
|
* make more standard libraries work with `nimPreviewSlimSystem` (#20343)ringabout2022-09-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | * make more standard libraries work with `nimPreviewSlimSystem` * typo * part two * Delete specutils.nim * fixes more tests * more fixes * fixes tests * fixes three more tests * add formatfloat import * fix * last
* make AsyncSocket.getPeerAddr work ; fix #15022 (#20038)David Krause2022-07-161-0/+2
| | | Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>
* Friendlier error message with solution (#19880)Carlo Capocasa2022-06-111-0/+5
| | | | | | | | | | | | | * Add helpful suggestion, should always apply * mention var param limitation in async docs * Update compiler/lambdalifting.nim whoops thanks Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com> Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
* Rework discarding futures documentation in asyncdispatch (#19738)huantian2022-05-021-6/+33
| | | | | | | | | | | | | | | | | | | | | | | | | * Rework discarding futures docs in asyncdispatch * Fix typos Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com> * Use rst note:: Co-authored-by: flywind <xzsflywind@gmail.com> * Split discarding and handling futures. * Update lib/pure/asyncdispatch.nim * Update lib/pure/asyncdispatch.nim * Update lib/pure/asyncdispatch.nim * Update lib/pure/asyncdispatch.nim Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com> Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* Fix doc: list of async backends (#19741)huantian2022-04-241-3/+3
|
* enable style:usages for stdlib tests [backport: 1.6] (#19715)flywind2022-04-131-3/+3
| | | | | | | | | | | | | | | * enable style:usages for stdlib tests * freeAddrInfo * more tests * importc * bufSize * fix more * => parseSql and renderSql
* enable `maxDescriptors` on Illumos/Solaris (#19295)BarrOff2021-12-301-2/+2
|
* Remove invalid statements about try in async docs. (#19108)Dominik Picheta2021-11-081-13/+13
|
* fixes another effect inference bug [backport:1.6] (#19100)Andreas Rumpf2021-11-071-2/+2
| | | | * fixes another effect inference bug [backport:1.6]
* Add Zephyr Support (#19003)Jaremy Creechley2021-10-241-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Remerge * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * fix maxDescriptors on zephyr/freertos * move maxDescriptors to selector.nim -- fixes compile issue * change realloc impl on zephyr to match ansi c behavior * change realloc impl on zephyr to match ansi c behavior * force compileOnly mode for tlwip Co-authored-by: Jaremy J. Creechley <jaremy.creechley@wavebaselabs.com> Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* Document `-d:async_backend` flag (#18700)Jacek Sieka2021-09-031-0/+28
| | | | | | | | | | | | | | | | | | | | * Document `-d:asyncBackend` flag Since libraries may want to support multiple async backends, it's useful to standardize the way this is done, so as to simplify usage of any async backend within the ecosystem. A similar text is being added to chronos here: https://github.com/status-im/nim-chronos/pull/216 See also https://github.com/status-im/nim-chronos/issues/207 * typos, add none * Update lib/pure/asyncdispatch.nim * Update lib/pure/asyncdispatch.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* various small documentation improvements (#18602)Miran2021-07-281-17/+17
|
* Fix a bug with starting of asynchronous processes (#18464)Ivan Bobev2021-07-081-1/+1
| | | | | | | The asynchronous process completion handler callback should be called only once. This is achieved by passing `WT_EXECUTEONLYONCE` flag to the `registerWaitForSingleObject` Windows API procedure. Related to cheatfate/asynctools#35
* Add commas to docs for clarity (#18398)Elliot Waite2021-06-291-2/+2
|
* move {.injectStmt.} to experimental; add a test (#18300)Timothee Cour2021-06-201-2/+0
| | | | | * move {.injectStmt.} to experimental; add a test * undocument and deprecat `.injectStmt` but keep its implementation until we have a replacement
* further progress on rst roles & directives (fix #17646) (#17659)Andrey Makarov2021-04-081-1/+1
| | | | | | | * further progress on rst roles & dir-s (fix #17646) * fix documents according to the messages * fix bug 17 from #17340
* Use `.. warning::` (#17320)konsumlamm2021-03-101-1/+1
|
* use .. warning:: (#17226)flywind2021-03-041-3/+3
| | | | | | | * remove unnecessary when statement * remove outdated codes * use warnings
* use single backtick (#17166)flywind2021-02-231-118/+118
|
* add -d:nimStrictMode in CI to keep code from regressing; fixes ↵Timothee Cour2021-02-171-1/+1
| | | | ConvFromXtoItselfNotNeeded, UnusedImport notes (#16764)
* Fix broken links in docs (#16336)Elliot Waite2020-12-141-1/+1
| | | | | * Fix broken links in docs * Fix rand HSlice links
* fixes #16154; underlying system.add for seq is the real cause; will be ↵Andreas Rumpf2020-11-271-2/+3
| | | | addressed in a follow-up PR (#16161)
* ported to FreeRTOSAraq2020-11-131-10/+12
|
* fixes 'nim doc'Araq2020-11-131-1/+1
|
* attempt to make asynchttpserver better; fixes #15925; [backport:1.0]Araq2020-11-131-0/+22
|
* ORC/ARC async progress (#15370)Andreas Rumpf2020-09-201-8/+7
| | | | | | | * ARC/ORC: fixes memory leak for empty seqs that have a non-zero capacity * async: minor refactorings * it helps to finish a refactoring
* ORC and stdlib optimizations (#15362)Andreas Rumpf2020-09-191-2/+6
|
* async: minor refactorings (#15354)Andreas Rumpf2020-09-181-15/+14
|
* export asyncdispatch handles (#15140)flywind2020-08-011-1/+1
| | | | | | | * improve epoll docs * export handles * add comments and changelog
* [Backport] Fixes callbacks being dropped on Linux/macOS/BSD. (#15012)Dominik Picheta2020-07-191-1/+6
| | | | | | | | | 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 (!).
* Removed asyncdispatch.newAsyncNativeSocket, was deprecated since 0.18 (#14854)Juan Carlos2020-06-301-10/+0
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Fix asyncdispatch drain behavior (#14820) (#14838)Ray Imber2020-06-301-4/+9
| | | | | | | | | | | * Fix asyncdispatch drain behavior (#14820) * Changed test to use asyncCheck instead of discard after code review (#14820) * Added some debug statements to help understand what is happening in Azure. * Removed debug statements and increased timeouts by 1 order of magnitude to account for slow Azure VMs Co-authored-by: Ray Imber <ray@crankuptheamps.com>
* Remove deprecated stuff from stdlib (#14699)Miran2020-06-171-1/+1
| | | | | | | * update to the latest Jester * remove deprecated procs from some stdlib modules * 'criterion' is not maintained anymore and relies on obsolete stuff
* asyncdispatch, asyncnet: add inheritance control (#14362)alaviss2020-05-201-14/+57
| | | | | * asyncdispatch, asyncnet: add inheritance control * asyncnet, asyncdispatch: cleanup
* Fix #14289 (#14304) [backport]slangmgh2020-05-111-1/+2
|
* JS unittest stacktrace fix, cleanup js repr and inclrtl includes (#14168)hlaaftana2020-04-301-2/+0
|
* asyncdispatch: export Callback (#14042) [backport]alaviss2020-04-211-2/+2
| | | | | | This let us see the definition of `Callback` in docs, which is required to even make use of asyncdispatch. Ref #13539.
* asyncdispatch: get rid of erroneous set constructions (#13877)alaviss2020-04-051-5/+9
| | | Ref #13764
* asyncdispatch: fix erroneous set construction (#13765)alaviss2020-03-261-1/+3
| | | | | | | These constants were defined as `cint`. They can be huge on certain systems, such as Haiku, and trigger out-of-bounds errors in asyncdispatch. Ref #13764.
* fix deprecations and other warnings (#13748)Miran2020-03-251-5/+5
|