hku-ect / libsphactor

"Extended nodal actor framework based on zactor"
Other
3 stars 4 forks source link

Api can be called through input sockets #100

Closed sphaero closed 11 months ago

sphaero commented 11 months ago

Still needs a test

sphaero commented 11 months ago

I'm doubting this change. The problem is that when you call an API through the SUB socket you expect an answer on the PUB socket. However it could be possible the actor was doing something while you were sending the API message. When you then receive an answer it could be from the work the actor was doing before you called the API.

Imagine this. The actor is doing some really long work. Meanwhile you request its name through its SUB socket. You immediately wait for an answer to this request. When you receive an answer it is not the name of the actor but just the result of the very long work.

sphaero commented 11 months ago

The only thing we can do is call API through the sub socket but never answer from it. This solves the problem.

Otherwise we need to implement state which is the beginning of the end.

sphaero commented 11 months ago

I'm not too happy with this change. Because we interfere with every message and I rather not. Better is to make a specific API socket? But let's move that to #101