What is the difference between Typed and UnTyped Actors in Akka? When to use what?

后端 未结 4 2016
我在风中等你
我在风中等你 2021-02-03 22:53

I have tried to read the Akka documentation to find out the exact difference between Typed and Untyped actors. When to use what? I am not sure what I\'m missing. Can somebody po

4条回答
  •  盖世英雄少女心
    2021-02-03 23:23

    Untyped actors respond to messages sent, while typed actors respond to method calls(the parameter values are the messages).

    Typed Actor Model is used in order to define strict contracts for actors that can respond to only the predefined set of messages. In this case, every message need not be encapsulated as one object; typed actors allow us to define separate methods that accept multiple inputs as defined by the contract. In Java parlance, typed actors provide the Java interface in the object-oriented world.[1]

    [1] Akka Essentials

提交回复
热议问题