Async call should be scheduled in loop

This commit is contained in:
Eloahman 2016-08-06 22:46:24 +08:00 committed by Brian Muller
parent 080ed21627
commit de78bd9b5d

View File

@ -1,8 +1,9 @@
import heapq import heapq
import time import time
import operator import operator
from collections import OrderedDict import asyncio
from collections import OrderedDict
from kademlia.utils import OrderedSet, sharedPrefix from kademlia.utils import OrderedSet, sharedPrefix
@ -158,7 +159,7 @@ class RoutingTable(object):
self.splitBucket(index) self.splitBucket(index)
self.addContact(node) self.addContact(node)
else: else:
self.protocol.callPing(bucket.head()) asyncio.ensure_future(self.protocol.callPing(bucket.head()))
def getBucketFor(self, node): def getBucketFor(self, node):
""" """