summaryrefslogtreecommitdiffstats
path: root/libdimension-python
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension-python')
-rw-r--r--libdimension-python/dimension.pxd4
-rw-r--r--libdimension-python/dimension.pyx8
2 files changed, 10 insertions, 2 deletions
diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd
index 3f89e71..4df0786 100644
--- a/libdimension-python/dimension.pxd
+++ b/libdimension-python/dimension.pxd
@@ -1,5 +1,5 @@
#########################################################################
-# Copyright (C) 2011 Tavian Barnes <tavianator@tavianator.com> #
+# Copyright (C) 2011-2014 Tavian Barnes <tavianator@tavianator.com> #
# #
# This file is part of The Dimension Python Module. #
# #
@@ -73,6 +73,8 @@ cdef extern from "../libdimension/dimension.h":
void dmnsn_future_cancel(dmnsn_future *future)
double dmnsn_future_progress(dmnsn_future *future)
void dmnsn_future_wait(dmnsn_future *future, double progress) nogil
+ void dmnsn_future_pause(dmnsn_future *future) nogil
+ void dmnsn_future_resume(dmnsn_future *future)
##########
# Timers #
diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx
index a50f247..7b6619f 100644
--- a/libdimension-python/dimension.pyx
+++ b/libdimension-python/dimension.pyx
@@ -1,5 +1,5 @@
#########################################################################
-# Copyright (C) 2011-2012 Tavian Barnes <tavianator@tavianator.com> #
+# Copyright (C) 2011-2014 Tavian Barnes <tavianator@tavianator.com> #
# #
# This file is part of The Dimension Python Module. #
# #
@@ -91,6 +91,12 @@ cdef class Future:
with nogil:
dmnsn_future_wait(self._future, progress)
+ def pause(self):
+ with nogil:
+ dmnsn_future_pause(self._future)
+ def resume(self):
+ dmnsn_future_resume(self._future)
+
# Let Futures be used as context managers
def __enter__(self):
return self