我有一个原消息我有两个Message Listener正在侦听相同的消息。如何确保一个侦听器先于另一个侦听器执行其代码?
Item.proto:
Message SetItemThing {
required string id;
}
CreateTableListener:
public void onMessage(SetItemThing msg) {
// Creates a table to put items in
}
CreateItemInTableListener:
public void onMessage(SetItemThing msg) {
// Puts item in a table that is going to be created
}
我想确保CreateTableListener的功能之前运行CreateItemInTableListener。由于他们得到相同的消息,我想知道是否有办法强制CreateTableListener先运行?
如果没有,什么是得到我想要的期望的功能的最佳方式? 我想只是让另一个消息,并发送一个不同的时间,但我即使我做到了,我想在我的应用程序,所以我仍然可以得到没有CreateTableListener先走了同样的问题的启动阶段,以发送这些消息。