Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
By:
Harmeet Singh (Taara)
Software Consultant
Agenda
1. Actor Model/Akka (Brief)
.
2. Finite State Machine (FSM)
3. Demo.
4. Leftover: The things we didn’t cover
ActorModel:Fundamentals
➔ All Computations is performed within Actor.
➔ Actors can communicate only through messages.
NOTE...
ActorModel:Fundamentals
➔ In response to a message, an actors can:
– Change its State or Behavior
– Send message to other ...
ActorModel:Fundamentals
-Actors can change their State or Behavior
➔ Each behavior in the system can represent a state,
an...
FiniteStateMachine(FSM):
-Actors can change their State or Behavior
If we are in state S and the event E occurs, we
should...
Finite State Machine (FSM)
➔ Common language independent modeling technique.
➔ FSM is defined by a number of states and th...
FiniteStateMachine(FSM):
-Visualize FSM
FiniteStateMachine(FSM)
–Case Study: Inventory System
FiniteStateMachine(FSM)
Case Study: Inventory System
Akka-FSM
FiniteStateMachine(FSM)
-User Cases
➔ Change actors behaviors according to state.
➔ Perform transitions during actor state...
Leftover:Thethingswedidn’tcover
➔ Shared state with Agents.
➔ Akka persistence.
➔ Actor Model with DDD (Domain Driven Desi...
References:
➔ Applied Akka Patterns By
Michael Nash and Wade Waldron.
➔ Learning Akka By Jason Goodwin.
➔ Akka in Action B...
Akka Finite State Machine
Akka Finite State Machine
Prochain SlideShare
Chargement dans…5
×

Akka Finite State Machine

1 559 vues

Publié le

In Actors system, we can change State or Behaviors during runtime in actors. There are multiple ways for changing behaviors like conditional based and Hotswap but Finite State Machine(FSM) is the cleanest way. If we have finite number of state in our system then FSM is the good practice.

Publié dans : Logiciels
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Akka Finite State Machine

  1. 1. By: Harmeet Singh (Taara) Software Consultant
  2. 2. Agenda 1. Actor Model/Akka (Brief) . 2. Finite State Machine (FSM) 3. Demo. 4. Leftover: The things we didn’t cover
  3. 3. ActorModel:Fundamentals ➔ All Computations is performed within Actor. ➔ Actors can communicate only through messages. NOTE: Modeling a software this allows you to deal with state in an atomic way, isolated way which is core principal of actor model.
  4. 4. ActorModel:Fundamentals ➔ In response to a message, an actors can: – Change its State or Behavior – Send message to other actors. – Create a finite number of child's
  5. 5. ActorModel:Fundamentals -Actors can change their State or Behavior ➔ Each behavior in the system can represent a state, and the actor can move from one state to the next when its receives a message. There are few mechanism we can use to change behavior in the face of different states: – Conditional Based on an Actor State. – Hotswat: become() and unbecome(). – Finite State Machine (FSM).
  6. 6. FiniteStateMachine(FSM): -Actors can change their State or Behavior If we are in state S and the event E occurs, we should perform the actions A and make a transition to the state S'. State(S) x Event(E) -> Actions (A), State(S')
  7. 7. Finite State Machine (FSM) ➔ Common language independent modeling technique. ➔ FSM is defined by a number of states and the different triggers for all possible transitions. ➔ Transitions are only happen when the machine is trigger by an event. ➔ Event in an Akka FSM are the messages that actor received.
  8. 8. FiniteStateMachine(FSM): -Visualize FSM
  9. 9. FiniteStateMachine(FSM) –Case Study: Inventory System
  10. 10. FiniteStateMachine(FSM) Case Study: Inventory System Akka-FSM
  11. 11. FiniteStateMachine(FSM) -User Cases ➔ Change actors behaviors according to state. ➔ Perform transitions during actor state change. ➔ Finite number of states. ➔ Model pure actor model using DDD.
  12. 12. Leftover:Thethingswedidn’tcover ➔ Shared state with Agents. ➔ Akka persistence. ➔ Actor Model with DDD (Domain Driven Design). ➔ Akka best Practices.
  13. 13. References: ➔ Applied Akka Patterns By Michael Nash and Wade Waldron. ➔ Learning Akka By Jason Goodwin. ➔ Akka in Action By Raymond Roestenburg (Author) , Rob Bakker (Author) and Rob W

×