Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opt WithID and GetPID accessor to engine #188

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

koola
Copy link

@koola koola commented Feb 18, 2025

This PR adds the following to engine;

WithID(id string) option (default is random int as string)
GetPID() accessor

Updated example remote to use SendWithSender with engines GetPID.

Registry *Registry
address string
remote Remoter
eventStream *PID
pid *PID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of actor framework is that actors should receive messages, and they are identified by PID. The engine itself should not have a PID. The engine is responsible for forwarding messages to actors, so PID does not make sense in engine struct

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then think of it as more of a convenience method. It doesn't affect anything which you have stated as a pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants