Test + fix for epoll and kqueue selector modules to properly unregister
event handles that have the key type "User"
This commit is contained in:
parent
5be8e0b088
commit
adc1419499
3 changed files with 26 additions and 3 deletions
23
tests/async/testmanyasyncevents.nim
Normal file
23
tests/async/testmanyasyncevents.nim
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
discard """
|
||||
output: '''
|
||||
hasPendingOperations: false
|
||||
triggerCount: 512
|
||||
'''
|
||||
"""
|
||||
|
||||
import asyncDispatch
|
||||
|
||||
var triggerCount = 0
|
||||
var evs = newSeq[AsyncEvent]()
|
||||
|
||||
for i in 0 ..< 512: # has to be lower than the typical physical fd limit
|
||||
var ev = newAsyncEvent()
|
||||
evs.add(ev)
|
||||
addEvent(ev, proc(fd: AsyncFD): bool {.gcsafe,closure.} = triggerCount += 1; true)
|
||||
|
||||
for ev in evs:
|
||||
ev.trigger()
|
||||
|
||||
drain()
|
||||
echo "hasPendingOperations: ", hasPendingOperations()
|
||||
echo "triggerCount: ", triggerCount
|
||||
Loading…
Add table
Add a link
Reference in a new issue