Service Fabric Actor Lifecycle Inquiry

WhitW 41 Reputation points
2020-07-24T08:49:54.357+00:00

The documentation states that OnActivateAsync is called whenever an actor is activated. Specifically, "when a call comes for an actor and one is not already active, a new actor is created" at which point its state is loaded if it has any and then OnActivateAsync is called.

If the actor is deactivated and later re-activated, will it call OnActivateAsync again or does that only call when an actor is activated for only the first time?

Thank you!

Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
257 questions
{count} votes

Accepted answer
  1. prmanhas-MSFT 17,901 Reputation points Microsoft Employee
    2020-07-24T10:20:01.56+00:00

    @WhitW Thank you for your query!!!

    OnActivateAsync will be called everytime actor is activated (not only first time). Once a actor has been deactivated and onDeactivateAsync has been called.

    If the actor is activated again, OnActivateAsync will be called again.

    Hope this helps.

    Do let me know in case of further concerns.

    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics

    0 comments No comments

0 additional answers

Sort by: Most helpful