Add timer functionality

This commit is contained in:
Jason Paryani
2014-04-10 19:08:24 -07:00
parent a3038ca8ec
commit f58f5d4846
5 changed files with 43 additions and 2 deletions

View File

@@ -100,6 +100,16 @@ cdef extern from "kj/array.h" namespace " ::kj":
ctypedef Promise[PyArray] PyPromiseArray
cdef extern from "kj/time.h" namespace " ::kj":
cdef cppclass Duration:
Duration(int64_t)
# cdef cppclass TimePoint:
# TimePoint(Duration)
cdef cppclass Timer:
# int64_t now()
# VoidPromise atTime(TimePoint time)
VoidPromise afterDelay(Duration delay)
cdef extern from "kj/async-io.h" namespace " ::kj":
cdef cppclass AsyncIoStream:
pass
@@ -107,6 +117,7 @@ cdef extern from "kj/async-io.h" namespace " ::kj":
# Own[AsyncInputStream] wrapInputFd(int)
# Own[AsyncOutputStream] wrapOutputFd(int)
Own[AsyncIoStream] wrapSocketFd(int)
Timer& getTimer() except +reraise_kj_exception
cdef cppclass AsyncIoProvider:
pass
cdef cppclass WaitScope: