EventBus
EventBus copied to clipboard
Code crash when publishing in a case of server/client eventBus
Hi! My issue is the following: I'm currently implementing a connection between 2 different code into the same computer. So I have a server and a client. I run the server and then the client. Then the server publish events which are read and execute by the client. But when I stop the clients code the server code is crashing.
After test and investigations I found that the subscribers map[string][]*SubscribeArg
map from the server
object is not updated when the client is disconnected. If the client is not working any more the subscribers
object is always the same.
So when I'm using server.HasClientSubscribed(&theArgs)
its responding always true event after the disconnection of the client.
My workaround is to use:
rpcClient, _ := rpc.DialHTTPPath("tcp", ":2010", "/_client_bus_")
and check if it not nil
before to make a publish
Is there a solution in order to update this map? Is there any another solution in order to avoid the crash of the code?
Best regards !
Still happens with latest versions 3 years later.