Commit 2756bd47 authored by Spencer Du's avatar Spencer Du

states added

parent ffa7ebd3
......@@ -5,7 +5,17 @@ from actorio import Actor, Message, DataMessage, ask, EndMainLoop, Reference
class Cameras(Actor):
# Here we override the handle_message method to send a `DataMessage` with the data "Hello World!".
async def handle_message(self, message: Message):
await message.sender.tell(DataMessage(data="Hello World Im a camera!", sender=self))
print("Unitialised")
await asyncio.sleep(2)
print("Initialising")
await asyncio.sleep(2)
print("Initialised")
await asyncio.sleep(2)
print("Configuring")
await asyncio.sleep(2)
print("Configured")
await asyncio.sleep(2)
await message.sender.tell(DataMessage(data="Hello World Im a camera!", sender=self))
async def main():
# Let's create an instance of a Greeter actor and start it.
async with Cameras() as cameras:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment