Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Is it acceptable to enable serialization between actors at one local galaxy node? #110
I've created a tiny project to play with - https://github.com/hsestupin/quasar-galaxy-issue
Expected behaviour is throwing the following exception:
In our project we use custom high-level protocol for interaction between actors which is implemented with simple actor-message passing underneath. Our protocol assumes that serialization is always enabled. And one of the messages contains ActorRef, and this forces actor to be serialized on one local galaxy node.
So the question is should we support the case of local actors interaction or is this a quasar/galaxy issue? Thanks
Grid.getInstance("\\config\\peerNoServer.xml", "\\config\\peer1.properties").goOnline(); ActorServer actorServer = new ActorServer(); ActorClient client = new ActorClient(); client.spawn(); client.register("client"); actorServer.spawn(); actorServer.register("server"); ActorRegistry.getActor("server"); final ActorRef<Object> clientGlobal = ActorRegistry.getActor("client"); final Behavior refLocal = actorServer.ref(); clientGlobal.send(refLocal);
When there is a call ActorRegistry.getActor ("server"), in co.paralleluniverse.remote.galaxy.GlxGlobalRegistry#getActor0 exhibited AbstractCacheListener, but when I send clientGlobal.send (refLocal), the object is serialized and Kryo serialization is co.paralleluniverse.io. serialization.kryo.ReplaceableObjectKryo#writeObject which call Actor writeReplace, which creates co.paralleluniverse.remote.galaxy.GlxGlobalRemoteActor and call in construct co.paralleluniverse.remote.galaxy.GlobalRemoteChannelReceiver#getReceiver, as was previously exhibited AbstractCacheListener we get ClassCastExeption.
Ok, I tried to simplify my example as much as possible. https://github.com/hsestupin/quasar-galaxy-issue
So I've initialized FlightRecorder and we can see what happens. You can run example the same way:
The code in Example1 class do the following:
Actually I don't think the use-case described above is somehow undesirable for quasar-actor system, doesn't it? It seems like its pretty ok to pass actor-refs to each other.