Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Paul Horn
@knutwalker
@cmrcmr spawning itself is just ActorOf(Props[T]) (uppercase A), if you do this from within an actor, it’s using context.actorOf, otherwise it’s using an implicit system.actorOf. Otherwise, yes, the ActorRef[T]#typed method is the correct one.
Marius B. Kotsbak
@mkotsbak
@knutwalker I don't understand "fail to compile when total handler is not exhaustive" vs "not fail when the unoinBecome.total doesnt match everything"
In your PR
Is that specifying the expected behavior or the current?
Paul Horn
@knutwalker
@mkotsbak i don’t see it right now, can you point me to it?
I would guess i was refering to the fact, that the scalac in certain situations does not produce a non-exhaustiveness warning when in fact not everything is checked and a runtime matcherror occurs
Paul Horn
@knutwalker
"fail to compile when total handler is not exhaustive" -> desired behavior
"not fail when the unoinBecome.total doesnt match everything" -> scalac issue
Marius B. Kotsbak
@mkotsbak
ok, but the first seems to not work as desired now?
As it is disabled
I was trying to implement total() for normal cases
Paul Horn
@knutwalker
this test makes sure, that there is no matcherror at runtime but the message goes to unhandled instead

the thing is,

unionBecome.total[Foo] {
                case Foo("foo") ⇒ inboxRef ! Foo("foo")
              }

is not exhaustive

but scalac fails to report this
Marius B. Kotsbak
@mkotsbak
ok, but the other one
Paul Horn
@knutwalker
the first one is an issue with specs2, I suppose. If I just write the code, the tests fail to compile, i just doens’t work for the typecheck matcher somehow
that’s why it’s disabled
btw, I have an idea to make Total polymorph in the sense that it will work for sub union types as well
so, you could use on(Total(…)) instead
Marius B. Kotsbak
@mkotsbak
Ok, good
Marius B. Kotsbak
@mkotsbak
Urk, there are some complications with adding the actor parameter, like this: TypedActor.scala:201: value class needs to have exactly one val parameter [error] final class MkPartialUnionReceive[U <: Union, S <: MkPartialUnionReceive.State] private[TypedActor] (self: Actor, val finalPf: Option[PartialFunction[U, Unit]]) extends AnyVal {
Paul Horn
@knutwalker
yeah, you have to remove the extends AnyVal there
Marius B. Kotsbak
@mkotsbak
Yes, assumed that. But there are more strange things: typecheck error: No ClassTag available for de.knutwalker.akka.typed.UnionSpec.Foo
Uhm, or, the typecheck macro needed that it seems
Are you going to merge that branch?
Paul Horn
@knutwalker
yes, the typecheck macro somehow can’t lookup the classtag parameter. you can provide it explicitly instead
do you mean #10 ?
Marius B. Kotsbak
@mkotsbak
No, #7
Paul Horn
@knutwalker
I’m not yet really happy with it, there are some things I wanted to add to it. Maybe even push the new Total approach first.
Marius B. Kotsbak
@mkotsbak
ok, i'm trying to build the normal total() on top of that topic branch then
Paul Horn
@knutwalker
ok, I will rebase that branch though, could probably get a little icky when you want to update
Marius B. Kotsbak
@mkotsbak
Ok, should be possible to rebase on that one again then. See knutwalker/typed-actors#11
Seems to work beside the disabled test
Paul Horn
@knutwalker
cool, thanks
Marius B. Kotsbak
@mkotsbak
Am I assuming right in that you are indirectly working on totalUnionBecome too?
Paul Horn
@knutwalker
yes
Marius B. Kotsbak
@mkotsbak
ok, then it would be a really great lib
ronanM
@ronanM
Hi, just a simple question (from a Akka newbie) : Is it possible to use remote (clustered) typed actors ?
Paul Horn
@knutwalker
Hi there. I haven’t personally tried typed-actors with remote/cluster but it should work. typed-actors have no runtime representation, so the actors you get are identical to regular akka actors und most of the work is done at compile-time. Since you can switch with untyped/typed between those two representations, I see no reason why it should not work with remote/cluster, though first hand experience would be nice :)
ronanM
@ronanM
Ok, Thanks !
ronanM
@ronanM
I try to Typed an Akka Cluster Sample, and I've got a compilation problem
https://github.com/akka/akka/blob/master/akka-samples/akka-sample-cluster-scala/src/main/scala/sample/cluster/transformation/TransformationBackend.scala#L36
context.actorSelection(RootActorPath(member.address) / "user" / "frontend") ! BackendRegistration
What is the Typed equivalent of context.actorSelection(...) ?
Paul Horn
@knutwalker
@ronanM Ah, I see. There isn’t any equivalent of actorSelection, though I see no reason why not. Could you open an issue for this?
ronanM
@ronanM
I create : knutwalker/typed-actors#15
Paul Horn
@knutwalker
thanks!
Marius B. Kotsbak
@mkotsbak
typedReceive is not working properly
class EmailSendingServiceActor(smtpConfig: SmtpConfig) extends
  TypedActor.Of[EmailSendingServiceActorProtocol] with ActorLogging {
  override def typedReceive = {
    case t: SmtpConfig =>

    case SendEmail(email) => {
      val logMsg = "Email: " + email
      log.info(logMsg)
      println(logMsg)
    }
  }
}
where:
sealed trait EmailSendingServiceActorProtocol
case class SendEmail(emailMessage: EmailMessage) extends EmailSendingServiceActorProtocol

case class SmtpConfig(....)
SmtpConfig is not a vaild part of the protocol. It should have given syntax error.
Stanislav Chetvertkov
@stanislav-chetvertkov
Hi everyone, I really like the library, but there were no updates since January, are there any plans for future improvements/development?
Paul Horn
@knutwalker
Hi, yes, I’ve been absent for a while, sorry about that. I have been pretty preoccupied (and still am, actually) at work with some demanding projects. I do have some plans for a 2.0, most of all a much much simpler way to use the union type and workarounds for some compiler issues. I’ve been battle testing this approach in some private projects and plan to resume development in about a month or so
Stanislav Chetvertkov
@stanislav-chetvertkov
@knutwalker cool, glad to hear that