Message and unload

Suppose that I have a (dynamically loaded) collection and:

  1. I send a message to the collection with msg.post
  2. I call unload on the collection.

It is guaranteed that the message got received and processed by the collection? Or the unload may happen BEFORE the message is received and processed?

Thanks!

If you send a message and call unload from the same chunk of code or in the same scope then I believe the message will have time to process. You should be able to test this yourself.

1 Like

@britzl Thanks for the reply.

Indeed I have asked since it seems to me that sometimes the message is not processed. So, since you are confirming that it is not guaranteed to be so, I will try a different logic.

Ciao, Rocco.

I said that it depends on when the two messages are sent. Messages are processed multiple times per frame:

Thanks for the reference. I have looked at the diagram and now it is no more clear to me…

I have the following two lines of code:

msg.post(room_id, “closing_”)
collectionfactory.unload(room_factory)

I seems to me that SOMETIMES the message sent in the first line is not processed by the collection unloaded in the second line.

Is this possible?

Thanks again.

I don’t think so. Can you isolate to a minimal repro case?

I’ill try.

My conclusion was based ONLY on a bug which could be explained by the message not being processed. I have moved the code processing “closing_” to the final method and the bug seems fixed.

For the moment I am going to reintroduce the old logic and try a simple print on that message.

1 Like