Skip to content

Commit

Permalink
python: add cancelPut
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Béraud committed Nov 7, 2023
1 parent 805cdbe commit 5ca7b8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/opendht.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ cdef class DhtRunner(_WithID):
while pending > 0:
lock.wait()
return ok

def cancelPut(self, InfoHash key, Value val):
self.thisptr.get().cancelPut(key._infohash, val._value)

def listen(self, InfoHash key, value_cb):
t = ListenToken()
t._h = key._infohash
Expand Down
1 change: 1 addition & 0 deletions python/opendht_cpp.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ cdef extern from "opendht/dhtrunner.h" namespace "dht":
string getSearchesLog(sa_family_t af) const
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 cancelPut(InfoHash key, shared_ptr[Value] val)
ListenToken listen(InfoHash key, ValueCallback get_cb)
void cancelListen(InfoHash key, SharedListenToken token)
vector[unsigned] getNodeMessageStats(bool i)
Expand Down

0 comments on commit 5ca7b8d

Please sign in to comment.