Skip to content
Snippets Groups Projects
Commit 5ca7b8d6 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

python: add cancelPut

parent 805cdbed
No related branches found
No related tags found
No related merge requests found
...@@ -636,6 +636,10 @@ cdef class DhtRunner(_WithID): ...@@ -636,6 +636,10 @@ cdef class DhtRunner(_WithID):
while pending > 0: while pending > 0:
lock.wait() lock.wait()
return ok return ok
def cancelPut(self, InfoHash key, Value val):
self.thisptr.get().cancelPut(key._infohash, val._value)
def listen(self, InfoHash key, value_cb): def listen(self, InfoHash key, value_cb):
t = ListenToken() t = ListenToken()
t._h = key._infohash t._h = key._infohash
......
...@@ -267,6 +267,7 @@ cdef extern from "opendht/dhtrunner.h" namespace "dht": ...@@ -267,6 +267,7 @@ cdef extern from "opendht/dhtrunner.h" namespace "dht":
string getSearchesLog(sa_family_t af) const string getSearchesLog(sa_family_t af) const
void get(InfoHash key, GetCallback get_cb, DoneCallback done_cb, nullptr_t f, Where w) void get(InfoHash key, GetCallback get_cb, DoneCallback done_cb, nullptr_t f, Where w)
void put(InfoHash key, shared_ptr[Value] val, DoneCallback done_cb, time_point created, bool permanent) void put(InfoHash key, shared_ptr[Value] val, DoneCallback done_cb, time_point created, bool permanent)
void cancelPut(InfoHash key, shared_ptr[Value] val)
ListenToken listen(InfoHash key, ValueCallback get_cb) ListenToken listen(InfoHash key, ValueCallback get_cb)
void cancelListen(InfoHash key, SharedListenToken token) void cancelListen(InfoHash key, SharedListenToken token)
vector[unsigned] getNodeMessageStats(bool i) vector[unsigned] getNodeMessageStats(bool i)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment