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

Improvement the Protocol #8

Closed
wants to merge 40 commits into from
Closed

Improvement the Protocol #8

wants to merge 40 commits into from

Conversation

sleipnir
Copy link
Member

No description provided.

@marcellanz
Copy link
Member

Thanks Adrinao, I'll have a look.

// See Command description Above
Command command = 2;
}

Copy link
Collaborator

@eliasdarruda eliasdarruda Jul 16, 2022

Choose a reason for hiding this comment

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

suggestion:

// Similar to TimerCommand but only executes commands following the Cron Expression
message CronCommand {

    // The expression the cron execution will follow, example: "* 5 * * *"
    string expression = 1;
    
    // See Command description Above
    Command command = 2;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem with Timers and Crons is that the user needs to remember that Spawn Actors by default live a specific period of time before they deactivate. So they need to set a timeout for deactivation longer than the Timer or Cron timeout, which sometimes becomes complicated to configure especially with Cron's proposal.
I see that we will have to create a new deactivation strategy that is possible to use when the user is going to use Timers or Crons, probably an infinite time strategy, that is, that never deactivates an actor that has declared timers or crons.

Comment on lines 135 to 138
ActorSnapshotStrategy snapshot_strategy = 6;

// Deactivate strategy
ActorDeactivateStrategy deactivate_strategy = 7;
Copy link
Collaborator

Choose a reason for hiding this comment

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

WDYT of grouping snapshot, deactivate and persistent in a single interface called persistence?

Also WDYT of naming ActorSnapshotStrategy to ActorStateStoreStrategy

message ActorPersistence {
   bool (definitive or persistent) = 1;
   
   ActorSnapshotStrategy snapshot_strategy = 2;
   ActorDeactivateStrategy deactivate_strategy = 3;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks good to me. I will add

Copy link
Member

Choose a reason for hiding this comment

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

Could we use ActorDeactivationStrategy instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could we use ActorDeactivationStrategy instead?

I thought more about it and actually snapshot strategies are needed for actor state management whereas deactivation strategies are needed for actor lifecycle management. I think they are different things that if they were grouped together should have a neutral name.

WDYT @marcellanz and @eliasdarruda

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe renaming it as ActorLifecycleStrategy as you described then?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe renaming it as ActorLifecycleStrategy as you described then?

I just submitted a new commit I grouped these types inside a new type which I called ActorConfiguration. All right for you @eliasdarruda and @marcellanz ?

Copy link
Member

Choose a reason for hiding this comment

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

Perfect, thanks @sleipnir

Copy link
Collaborator

@eliasdarruda eliasdarruda left a comment

Choose a reason for hiding this comment

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

I've commented some suggestions

@sleipnir
Copy link
Member Author

I've commented some suggestions

Thank you for your comments

@sleipnir sleipnir marked this pull request as draft September 9, 2022 19:05
@sleipnir sleipnir added this to the v1.0.0 milestone Sep 9, 2022
@sleipnir
Copy link
Member Author

The last commits that entered the main branch evolved most of the needs of this PR. So I will close this PR and treat the other parts in other PRs.

@sleipnir sleipnir closed this Oct 13, 2022
@sleipnir sleipnir deleted the feat/protocol-improvement branch January 27, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request protocol Specification of protocol
Projects
No open projects
Status: Done
3 participants