Reputation: 451
I implemented the lazy pirate pattern for my client module, which works great for retrying the requests. But here's the problem.
That's the problem, I'm executing the action twice which was intended to be only executed once. I think this is the best way I could explain it.
In certain occasions client can send simultaneously send request to server as I have a coroutine running on a thread, separated from the main thread both of which has functionality that sends request to server. Could this be the cause of it?
I also have multiple of these clients connected to the server, could this be the problem?
Thank you!
Upvotes: 0
Views: 328
Reputation: 1
Q1 : "Could this ... coroutine based co-existence ... be the cause of it?"
Yes, mostly if coroutines use the same instance of the REQ
-archetype.
Q2 : "... could this ... multiple of these clients connected to the server ... be the problem?"
No, given each client operates on it's own instance of a REQ
-archetype, connected towards the REP
-(server)-side, there ought be no reason to imminent blocks ( for details, read more about the REQ/REP
principal certainty to fall into an un-salvagable mutual dead-lock, where the only thing you cannot know is, when it will happen, but we all may be sure, it will happen )
If an atomic, singleton-alike unique executions are needed ( and if server implementation permits that ), one may log each REQ
's task-{UUID}
, to prevent double-shots onto the same task-target.
There is hardly to tell more, without the actual MCVE / MWE-representation of the problem ( the .poll
-ing loop logic / timeout / remedy-strategies ).
Upvotes: 1