@@ -35,8 +35,8 @@ pjoin = os.path.join
|
|||||||
# Constants
|
# Constants
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
bundled_version = (0,5,3,1)
|
bundled_version = (0,6,0)
|
||||||
libcapnp = "capnproto-c++-%i.%i.%i.%i.tar.gz" % (bundled_version)
|
libcapnp = "capnproto-c++-%i.%i.%i.tar.gz" % (bundled_version)
|
||||||
libcapnp_url = "https://capnproto.org/" + libcapnp
|
libcapnp_url = "https://capnproto.org/" + libcapnp
|
||||||
|
|
||||||
HERE = os.path.dirname(__file__)
|
HERE = os.path.dirname(__file__)
|
||||||
|
|||||||
@@ -101,7 +101,14 @@ ctypedef Promise[PyArray] PyPromiseArray
|
|||||||
|
|
||||||
cdef extern from "kj/time.h" namespace " ::kj":
|
cdef extern from "kj/time.h" namespace " ::kj":
|
||||||
cdef cppclass Duration:
|
cdef cppclass Duration:
|
||||||
Duration(int64_t)
|
Duration operator*(int64_t)
|
||||||
|
Duration NANOSECONDS
|
||||||
|
Duration MICROSECONDS
|
||||||
|
Duration MILLISECONDS
|
||||||
|
Duration SECONDS
|
||||||
|
Duration MINUTES
|
||||||
|
Duration HOURS
|
||||||
|
Duration DAYS
|
||||||
# cdef cppclass TimePoint:
|
# cdef cppclass TimePoint:
|
||||||
# TimePoint(Duration)
|
# TimePoint(Duration)
|
||||||
cdef cppclass Timer:
|
cdef cppclass Timer:
|
||||||
@@ -109,6 +116,9 @@ cdef extern from "kj/time.h" namespace " ::kj":
|
|||||||
# VoidPromise atTime(TimePoint time)
|
# VoidPromise atTime(TimePoint time)
|
||||||
VoidPromise afterDelay(Duration delay)
|
VoidPromise afterDelay(Duration delay)
|
||||||
|
|
||||||
|
cdef inline Duration Nanoseconds(int64_t nanos):
|
||||||
|
return NANOSECONDS * nanos
|
||||||
|
|
||||||
cdef extern from "kj/async-io.h" namespace " ::kj":
|
cdef extern from "kj/async-io.h" namespace " ::kj":
|
||||||
cdef cppclass AsyncIoStream:
|
cdef cppclass AsyncIoStream:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1688,7 +1688,7 @@ cdef class _Timer:
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
cpdef after_delay(self, time) except +reraise_kj_exception:
|
cpdef after_delay(self, time) except +reraise_kj_exception:
|
||||||
return _VoidPromise()._init(self.thisptr.afterDelay(capnp.Duration(time)))
|
return _VoidPromise()._init(self.thisptr.afterDelay(capnp.Nanoseconds(time)))
|
||||||
|
|
||||||
def getTimer():
|
def getTimer():
|
||||||
return _Timer()._init(helpers.getTimer(C_DEFAULT_EVENT_LOOP_GETTER().thisptr))
|
return _Timer()._init(helpers.getTimer(C_DEFAULT_EVENT_LOOP_GETTER().thisptr))
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -13,8 +13,8 @@ from distutils.extension import Extension
|
|||||||
_this_dir = os.path.dirname(__file__)
|
_this_dir = os.path.dirname(__file__)
|
||||||
|
|
||||||
MAJOR = 0
|
MAJOR = 0
|
||||||
MINOR = 5
|
MINOR = 6
|
||||||
MICRO = 12
|
MICRO = 0
|
||||||
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
|
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user