-
Notifications
You must be signed in to change notification settings - Fork 5
feat!: unify GenServer self and state #35
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
Conversation
| const TIMEOUT_DURATION: Duration = Duration::from_millis(100); | ||
|
|
||
| #[derive(Default)] | ||
| #[derive(Debug, Default, Clone)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default is no longer needed, right?
|
|
||
| impl GenServer for SomeTask { | ||
| type CallMsg = SomeTaskCallMsg; | ||
| type CastMsg = (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this PR, but maybe we can move all these () to Unused 👉 👈?
ElFantasma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
**Motivation** Update Spawned to accomodate new Actor interface. **Description** Since [spawned `0.2.0`](lambdaclass/spawned#35) the state and GenServer is "the same".
**Motivation** Update Spawned to accomodate new Actor interface. **Description** Since [spawned `0.2.0`](lambdaclass/spawned#35) the state and GenServer is "the same".
This PR removes the state parameter of the
GenServertrait to useselfinstead. This reduces the number of types required to add a newGenServer, but imposes more constraints on the wholeGenServer(before we had two "states": theGenServerimplementor, withSyncconstraint; and theGenServer::Statetype, withCloneconstraint, now we only have the second one).