question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement IRepliable?

See original GitHub issue

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 for Sender property (this is quite error prone) and limit the range of <? operator (to be used only when combined with repliable messages).

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
raymenscommented, Sep 3, 2015

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?

0reactions
Horusiathcommented, May 4, 2017

@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:

  • Right now we have Sender field that we use to store requester anyway. So we don’t have any performance benefit here.
  • This particular Ask version will break C# generic type inference: C# compiler won’t be able to infer generics, so they will have to be passed explicitly, which is gross.
  • On the F# side you cannot write mutual generic constraints between two generic types.
  • Also for F# this would require to annotate messages with IRepliable<> interface which may be neutral for records, but it’s totally horrible if you have to implement it on the discriminated union.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Oracle iReceivables
Use the Messages window in the Oracle Application Object Library to edit ... All iReceivables messages use the prefix “ARI” or "OIR" in...
Read more >
Idea: allow `tell` to yield execution context · Issue #77
Behaviors.receive { (ctx, request: IRepliable[Response]) => for ... we can use tell continuation to suspend current execution in order to ...
Read more >
MVIE: Know you by Ladipoe ft. Simi IreFlexible
Simi IreFlexible. Leisure. This one has long been in my drafts. Working on it now, I can say I'm proud of me. I'm...
Read more >
CA1063: Implement IDisposable correctly (code analysis)
The System.IDisposable interface is not implemented correctly. Possible reasons for this include: IDisposable is reimplemented in the class.
Read more >
Adron homes: Application process and terminologies to ...
Some info are insider's information. But, here I am, your unpaid tattler, giving you za juice. We both know there's more to know,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found