Implements `asyncdispatch.getIoHandler` and assert on nil futures.
This commit is contained in:
parent
e5a27c96fb
commit
325e4520ec
3 changed files with 12 additions and 0 deletions
|
|
@ -262,6 +262,11 @@ when defined(windows) or defined(nimdoc):
|
|||
setGlobalDispatcher(newDispatcher())
|
||||
result = gDisp
|
||||
|
||||
proc getIoHandler*(disp: PDispatcher): Handle =
|
||||
## Returns the underlying IO Completion Port handle (Windows) or selector
|
||||
## (Unix) for the specified dispatcher.
|
||||
return disp.ioPort
|
||||
|
||||
proc register*(fd: cint | SocketHandle | AsyncFD): AsyncFD {.discardable.} =
|
||||
## Registers ``fd`` with the dispatcher.
|
||||
##
|
||||
|
|
@ -1103,6 +1108,9 @@ else:
|
|||
setGlobalDispatcher(newDispatcher())
|
||||
result = gDisp
|
||||
|
||||
proc getIoHandler*(disp: PDispatcher): Selector[AsyncData] =
|
||||
return disp.selector
|
||||
|
||||
proc register*(fd: cint | SocketHandle | AsyncFD): AsyncFD {.discardable.} =
|
||||
let p = getGlobalDispatcher()
|
||||
when fd is AsyncFD:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue