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

Use implicit ActorRefFactory instead of ActorSystem for creating SlackRTMClient #75

Open
vavison opened this issue Jul 30, 2018 · 1 comment

Comments

@vavison
Copy link

vavison commented Jul 30, 2018

The creation of a SlackRTMClient requires an implicit ActorSession to be in scope

object SlackRtmClient {
  def apply(token: String, duration: FiniteDuration = 5.seconds)(implicit arf: ActorSystem): SlackRtmClient = {
    new SlackRtmClient(token, duration)
  }
}

I'm quite new to Akka so may have misunderstood something, but I think that this means all of the ActorRefs created by the SlackRtmClient will sit at the top level of the actor hierarchy?

Ideally, I would like these to be able to sit underneath other actors in the actor hierarchy. I think this would be possible by changing the implicit ActorSystem to be an implicit ActorRefFactory so that we can use the actor context instead of the system. I couldn't see anywhere where it needed to explicitly be an ActorSystem but there's a good chance I missed something!

I'm happy to work on this if you think it's a good idea. Please let me know if I've missed an important point somewhere.

@mccartney
Copy link
Collaborator

(another contributor here)

While I understand what you mean, I don't know enough of Akka to have some say.
I suggest you create a PR. I'll review it - either myself or consult with someone more knowledgeable with Akka.

Thanks.

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

No branches or pull requests

2 participants