Akka Typed: Stateful and Stateless Actors | Rock the JVM

Поділитися
Вставка

КОМЕНТАРІ •

  • @nimatrueway
    @nimatrueway 4 роки тому +5

    I love your tutorials! They are in perfect form.
    By the way, I can't wait to watch more of "Scala 3" series.

  • @aethermass
    @aethermass 4 роки тому +2

    Great intro to Behaviors with Akka Typed. I recommend doing a video with an example of an Akka Typed timer/scheduler. Cheers =)

    • @rockthejvm
      @rockthejvm  4 роки тому +1

      Will do - lots more incoming!

  • @no_more_free_nicks
    @no_more_free_nicks 2 роки тому +1

    Thanks that was a great introduction, I have a job interview where I have to create a simple service using actors.

  • @Nick-mp4jl
    @Nick-mp4jl 4 роки тому +1

    Thank you Daniel, really nice explained

  • @vicc8881
    @vicc8881 4 роки тому +5

    myHappiness += 100

  • @prashantkumar-hx1dv
    @prashantkumar-hx1dv 3 роки тому

    you an crate the actor using the actor system or by extending the actor trait

  • @javierramosrodriguez5512
    @javierramosrodriguez5512 4 роки тому +3

    Maybe it is just terminology, but for me both actors are stateful. They have internal state. One is mutable and another one is not.

    • @rockthejvm
      @rockthejvm  4 роки тому +2

      Sure - as long as you got the idea, that's all I wanted

    • @javierramosrodriguez5512
      @javierramosrodriguez5512 4 роки тому +1

      @@rockthejvm yes, as always, this video was very helpful. Thank you!

  • @christianvalverde1247
    @christianvalverde1247 4 роки тому

    There is something thats not clear to me. when using persistent typed actors, there is a trait EventSource which should not be extended wich is good for functional style actors .....all the samples use a singleton object ... what if i wanted to map each item in a warehouse to a persistent actor, then the problem is functional style forces me to use singleton objects ... so i cant find a way to use persistente actors in the scenario. ....... any clue would be appreciated.

    • @rockthejvm
      @rockthejvm  4 роки тому

      Having each item with its own persistent actor might be too granular.

    • @christianvalverde1247
      @christianvalverde1247 4 роки тому

      @@rockthejvm what should be the ideal case ?

    • @rockthejvm
      @rockthejvm  4 роки тому

      @@christianvalverde1247 it depends on what items you hold and how you access them, but the "DAO" should be a persistent actor

  • @GVLPedro
    @GVLPedro 4 роки тому +1

    Great !! very useful for PR :)

    • @rockthejvm
      @rockthejvm  4 роки тому

      Glad it helps!

    • @GVLPedro
      @GVLPedro 4 роки тому +1

      @@rockthejvm I would like a video showing the different types of ExecutionContext (scala.concurrent.ExecutionContext.Implicits.global) and when to use.

  • @prashantsable7982
    @prashantsable7982 2 роки тому

    Great Video.
    Quick question - For some if I wanted to retry the message, How can we achieve it without waiting for the next message. i.e. If you just send "emotionalActorSystem ! EatChocolate" I wanted to execute it 2 times based on some condition without waiting for the next message.
    Can we do context.self ! EatChocolate

    • @rockthejvm
      @rockthejvm  2 роки тому

      You can simply send the message twice, i.e. call `emotionalActorSystem ! EatChocolate` two times?

  • @mangos1346
    @mangos1346 3 роки тому +2

    akka-typed seems unnecessary complicated than akka-actor, and with constant creation of new object of behavior for every incoming message, it seems like a performance penalty. Why would we use akka-typed in the first place?

    • @rockthejvm
      @rockthejvm  3 роки тому

      Boilerplate has nothing to do with performance. This code is what aesthetics sacrifice for type safety, which was one of the major flaws of "old" actors.