elfo-rs / elfo

An asynchronous distributed actor framework in Rust with robust observability
217 stars 12 forks source link

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

Closed nerodono closed 1 month ago

nerodono commented 1 month ago

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.

loyd commented 1 month ago

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

nerodono commented 1 month ago

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

nerodono commented 1 month ago

One moment, seems like I need to fix up more