fix some event name collisions with multiple CR's, tag some more methods BLOCKING

This commit is contained in:
David Rose 2009-12-05 19:39:13 +00:00
parent e749054ba5
commit b0993e4a53
5 changed files with 17 additions and 12 deletions

View File

@ -55,7 +55,8 @@ class ClientRepository(ClientRepositoryBase):
def createReady(self):
# Now that we've got a doId range, we can safely generate new
# distributed objects.
messenger.send('createReady')
messenger.send('createReady', taskChain = 'default')
messenger.send(self.uniqueName('createReady'), taskChain = 'default')
def handleRequestGenerates(self, di):
# When new clients join the zone of an object, they need to hear

View File

@ -100,10 +100,6 @@ class ClientRepositoryBase(ConnectionRepository):
## self.send(datagram)
## # Make sure the message gets there.
## self.flush()
# Define uniqueName
def uniqueName(self, desc):
return desc
def specialName(self, label):
name = ("SpecialName %s %s" % (self.specialNameNumber, label))

View File

@ -56,6 +56,10 @@ class ConnectionRepository(
self.config = config
# Create a unique ID number for each ConnectionRepository in
# the world, helpful for sending messages specific to each one.
self.uniqueId = hash(self)
if self.config.GetBool('verbose-repository'):
self.setVerbose(1)
@ -646,6 +650,9 @@ class ConnectionRepository(
self.notify.info('*** RESTORING SIMULATED PULLED-NETWORK-PLUG ***')
self.setSimulatedDisconnect(0)
def uniqueName(self, idString):
return ("%s-%s" % (idString, self.uniqueId))
class GCTrigger:
# used to trigger garbage collection
pass

View File

@ -179,5 +179,6 @@ class TimeManager(DistributedObject.DistributedObject):
return
self.notify.info("Giving up on uncertainty requirement.")
messenger.send("gotTimeSync")
messenger.send("gotTimeSync", taskChain = 'default')
messenger.send(self.cr.uniqueName("gotTimeSync"), taskChain = 'default')

View File

@ -106,11 +106,11 @@ PUBLISHED:
void stop_delay();
#endif
bool check_datagram();
BLOCKING bool check_datagram();
#ifdef HAVE_PYTHON
#ifdef WANT_NATIVE_NET
bool check_datagram_ai(PyObject *PycallBackFunction);
bool network_based_reader_and_yielder(PyObject *PycallBackFunction,ClockObject &clock, float returnBy);
BLOCKING bool check_datagram_ai(PyObject *PycallBackFunction);
BLOCKING bool network_based_reader_and_yielder(PyObject *PycallBackFunction,ClockObject &clock, float returnBy);
#endif
#endif
@ -126,7 +126,7 @@ PUBLISHED:
bool is_connected();
bool send_datagram(const Datagram &dg);
BLOCKING bool send_datagram(const Datagram &dg);
INLINE void set_want_message_bundling(bool flag);
INLINE bool get_want_message_bundling() const;
@ -140,8 +140,8 @@ PUBLISHED:
void abandon_message_bundles();
void bundle_msg(const Datagram &dg);
bool consider_flush();
bool flush();
BLOCKING bool consider_flush();
BLOCKING bool flush();
void disconnect();
void shutdown();