2.5 KiB
Integration with Actor Frameworks
This article introduces how Dapr integrate with existing Actor Frameworks such as Orleans, Akka, and Service Fabric Reliable Actors. With Dapr integration, these Actor frameworks will allow developers to write Actor code in any programming languages, and to plug their Actors into Dapr eventing pipeline that enables reliable messaging, pub-sub, binding to event sources and many other features.
Client-side integration
On the client side, Dapr acts as a shim in front of an Actor proxy. This allows Dapr to bring reliable messaging, binding and other features to the connected Actor framework.

Server-side integration
On the server side, Dapr leverages Actor framework capabilities such as state management and single activation guarantee to offer complete Actor framework capabilities. Dapr defines an Actor API, which the integrated Actor frameworks are supposed to implement/support.
Dapr comes with a built-in Actor framework implemenation through the same Actor API.
The following diagram illustrates two possible execution paths. 
Client calling an Actor (green path)
- A client makes a call to an Actor instance.
- Dapr calls an Actor proxy to forward the request.
- As the Actor runtime activates/invokes an Actor, it calls Dapr through the Actor API to invoke the user method.
- Dapr forwards the request to user code through Dapr API.
- As the response is returned, it was sent back to client as a response to the original request.
A message triggering an Actor (yellow path)
- A message is routed to the Dapr instance that is hosting the destination Actor.
- Dapr dispatches the message to the Actor runtime when possible.
- The rest of the steps are the same as the green path.
Actor API
At a high level, the Actor API shall contain the following methods:
- Dispatch to Actor when possible
- Call method on an Actor now
- Load/save state
- Create/remove
- Locate & send message to an Actor
Custom Programming Experience
Custom programming experiences can be built on top of Dapr through a custom library. The Custom library adapts Dapr API to a custom API shape that the user code consumes, as shown in the following diagram:
