CA
extended-salmon
Using the Actor instance across multiple files
Hi, how can i use the same actor instance across multiple functions defined in seperate files?
for example, if I define an Actor in the main.py file as:
async with Actor:
(some code)
How do i use Actor.log.info() in another function that is called from the main script?
Would appreciate any help in this.
3 Replies
@Deepak Antony just advanced to level 1! Thanks for your contributions! 🎉
@Deepak Antony Hey
just use it everywhere.
Think of it as a singleton
After calling
In all imports you will refer to this particular Actor
extended-salmonOP•12mo ago
This is what I was wondering. As I checked the instance id across different files, they were all the same.
Thank you for confirming @Mantisus