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

feat(core): introduce status_kind in the Context #133

Merged
merged 7 commits into from
Jul 17, 2024

Conversation

nerodono
Copy link
Contributor

When user has special logic for, say, termination (i.e. waiting for some other actors to finish), it has to keep track of status as the internal state:

struct MyState {
    // .. some useful data about actor's internal state ..
    terminating: bool, // <-- flag that actor should do clean-up actions before termination
}

This can cause bugs that are difficult to catch (forgetting about the terminating flag when updating the state). Instead, we can provide some API to read actor's status, so user is not obligated with keeping status-related information in the internal state.

elfo-core/src/context.rs Outdated Show resolved Hide resolved
@loyd
Copy link
Collaborator

loyd commented Jul 16, 2024

Add a record into CHANGELOG.md please with reference to the current PR

@nerodono
Copy link
Contributor Author

Resolved everything at 73db5e3 (needs careful review)
Changedlog at 2f7bbc8

@nerodono nerodono force-pushed the feat/status_kind-in-context branch from 2f7bbc8 to fdd3470 Compare July 16, 2024 16:48
CHANGELOG.md Outdated Show resolved Hide resolved
elfo-core/src/actor.rs Outdated Show resolved Hide resolved
elfo-core/src/context.rs Outdated Show resolved Hide resolved
elfo-core/src/lib.rs Outdated Show resolved Hide resolved
elfo-core/src/actor.rs Outdated Show resolved Hide resolved
@nerodono
Copy link
Contributor Author

One moment, seems like I need to fix up more

@nerodono nerodono force-pushed the feat/status_kind-in-context branch from b1775b0 to de165a3 Compare July 17, 2024 13:55
@loyd loyd merged commit e498d53 into elfo-rs:master Jul 17, 2024
7 checks passed
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