Avoid exposing internal Message type to public interface #323
-
Hey, I have an actor with an As actors can only handle one message type, is it possible to hide that internal message and not expose it along the public |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Another Question: In Erlang/Elixir it is a common pattern to provide API functions that call or cast into the actors to make using actors look more like normal procedural code and as there's no typechecks for messages, hide the message type for error safety. Is this also a thing for Ractor. What can be the benefit of doing so? |
Beta Was this translation helpful? Give feedback.
-
You might be able to derive something with
For this part, yes it should be possible by doing the following
or something like that ^ |
Beta Was this translation helpful? Give feedback.
In that case you'd want to wrap that actor in another actor "parent" which exposes a subset of the messages. What you're referring to isn't directly supported unfortunately