split FutureStream from asyncfutures
This commit is contained in:
parent
e86863e8f5
commit
93827e6ab8
4 changed files with 117 additions and 109 deletions
|
|
@ -9,11 +9,12 @@
|
|||
|
||||
include "system/inclrtl"
|
||||
|
||||
import os, tables, strutils, times, heapqueue, options, asyncfutures
|
||||
import os, tables, strutils, times, heapqueue, options, asyncstreams
|
||||
import asyncfutures except callSoon
|
||||
import nativesockets, net, deques
|
||||
|
||||
export Port, SocketFlag
|
||||
export asyncfutures
|
||||
export asyncfutures, asyncstreams
|
||||
|
||||
#{.injectStmt: newGcInvariant().}
|
||||
|
||||
|
|
@ -188,7 +189,7 @@ proc adjustedTimeout(p: PDispatcherBase, timeout: int): int {.inline.} =
|
|||
result = int((timerTimeout - curTime) * 1000)
|
||||
if result < 0: result = 0
|
||||
|
||||
proc callSoon*(cbproc: proc ()) {.gcsafe.}
|
||||
proc callSoon(cbproc: proc ()) {.gcsafe.}
|
||||
|
||||
proc initGlobalDispatcher =
|
||||
if asyncfutures.callSoonProc == nil:
|
||||
|
|
@ -1336,7 +1337,7 @@ proc recvLine*(socket: AsyncFD): Future[string] {.async, deprecated.} =
|
|||
return
|
||||
add(result, c)
|
||||
|
||||
proc callSoon*(cbproc: proc ()) =
|
||||
proc callSoon(cbproc: proc ()) =
|
||||
## Schedule `cbproc` to be called as soon as possible.
|
||||
## The callback is called when control returns to the event loop.
|
||||
getGlobalDispatcher().callbacks.addLast(cbproc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue