@@ -1638,6 +1638,7 @@ _THREAD_LOCAL_EVENT_LOOPS = []
|
|||||||
|
|
||||||
cdef _EventLoop C_DEFAULT_EVENT_LOOP_GETTER():
|
cdef _EventLoop C_DEFAULT_EVENT_LOOP_GETTER():
|
||||||
'Optimization for not having to deal with threadlocal event loops unless we need to'
|
'Optimization for not having to deal with threadlocal event loops unless we need to'
|
||||||
|
global C_DEFAULT_EVENT_LOOP
|
||||||
if C_DEFAULT_EVENT_LOOP is not None:
|
if C_DEFAULT_EVENT_LOOP is not None:
|
||||||
return C_DEFAULT_EVENT_LOOP
|
return C_DEFAULT_EVENT_LOOP
|
||||||
elif _C_DEFAULT_EVENT_LOOP_LOCAL is not None:
|
elif _C_DEFAULT_EVENT_LOOP_LOCAL is not None:
|
||||||
@@ -1647,8 +1648,9 @@ cdef _EventLoop C_DEFAULT_EVENT_LOOP_GETTER():
|
|||||||
else:
|
else:
|
||||||
_C_DEFAULT_EVENT_LOOP_LOCAL.loop = _EventLoop()
|
_C_DEFAULT_EVENT_LOOP_LOCAL.loop = _EventLoop()
|
||||||
return _C_DEFAULT_EVENT_LOOP_LOCAL.loop
|
return _C_DEFAULT_EVENT_LOOP_LOCAL.loop
|
||||||
|
else:
|
||||||
raise KjException("You don't have any EventLoops running. Please make sure to add one")
|
C_DEFAULT_EVENT_LOOP = _EventLoop()
|
||||||
|
return C_DEFAULT_EVENT_LOOP
|
||||||
|
|
||||||
cdef class _Timer:
|
cdef class _Timer:
|
||||||
cdef capnp.Timer * thisptr
|
cdef capnp.Timer * thisptr
|
||||||
|
|||||||
Reference in New Issue
Block a user