-
Notifications
You must be signed in to change notification settings - Fork 45
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
Implement IRepliable? #1
Comments
So if I read this correctly, you'd like to improve sending the reply that's currently something like: |
Basically yes. Problem with Marking messages with This idea also comes from akka-typed module on the JVM. |
Then this would get a big +1 from me, as I've always thought the current implementation was just wrong. Have you already done some partial work on this in a branch? |
It's awesome! |
I've seen a lot of resistance in the past adding external dependencies to message contract libraries. Would this also require messages to be mutable? Or more than a simple record? |
@Neftedollar @lavinski the idea here is quite simple, but I guess it needs to be implemented on Akka level to actually bring not only compile time verification, but also performance benefit. Essential code looks like this: interface IRepliable<TReply> { IActorRef<TReply> ReplyTo { get; } }
static Task<TReply> Ask<TReq, TReply>(this ICanTell<TReq> target, TReq request)
where TReq : IRepliable<TReply> { ... } This way compiler could make sure, that all communicating sides will be able to handle each other's messages. However there are some problems with that:
|
The idea is to create a separate interface
IRepliable { replyTo: ICanTell }
which would be implemented by messages that are expected to wait for response from actor processing the message. This way we could eventually drop support forSender
property (this is quite error prone) and limit the range of<?
operator (to be used only when combined with repliable messages).The text was updated successfully, but these errors were encountered: