Skip to content

Commit

Permalink
document classes
Browse files Browse the repository at this point in the history
  • Loading branch information
rajan-chari committed Oct 21, 2024
1 parent ba2a18d commit 2f54a02
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion samples/apps/cap/py/autogencap/actor_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@


class IMsgActor(ABC):
"""Abstract base class for message based actors."""

@abstractmethod
def on_connect(self, runtime: "IRuntime"):
"""Called when the actor connects to the runtime."""
Expand Down Expand Up @@ -36,8 +38,9 @@ def dispatch_message(self, message):
pass


# Abstract base class for message receivers
class IMessageReceiver(ABC):
"""Abstract base class for message receivers. Implementations are runtime specific."""

@abstractmethod
def init(self, actor_name: str):
"""Initialize the message receiver."""
Expand All @@ -61,6 +64,8 @@ def stop(self):

# Abstract base class for the runtime environment
class IRuntime(ABC):
"""Abstract base class for the actor runtime environment."""

@abstractmethod
def register(self, actor: IMsgActor):
"""Register an actor with the runtime."""
Expand Down

0 comments on commit 2f54a02

Please sign in to comment.