lunatic-solutions / lunatic-rs

This library contains higher level Rust wrappers for low level Lunatic syscalls.
275 stars 31 forks source link

Add Recipient types, conversion functions to ProcessRef #90

Closed korbin closed 1 year ago

korbin commented 2 years ago

This PR adds an abstract MessageRecipient<M, S> and RequestRecipient<M, R, S> to ProcessRef<T>.

This allows storage of references to groups of processes that are all able to receive a specific message/request type, even if those processes are not the same underlying type. This allows for abstract pub/sub patterns.

Modeled after Actix's Recipient.

bkolobara commented 2 years ago

Thanks @korbin for the contribution! This looks good to me. Could you just add a few simple tests, so we don't accidentally break it in the future?

bkolobara commented 1 year ago

The API changed significantly making this PR outdated.