Closed objectiveSee closed 3 years ago
on a Pi you'd be running CPython not CircuitPython - we have a compatibility layer that lets you use CircuitPython libraries like this one. for performance questions, you can use any Python threading/optimization tutorial or online documentation - there's a ton of tutorials online for CPython!
Hey! Just checking out this library on my Raspberry Pi Zero. I am writing an Application that needs to handle async events from a Socket.io server. I have coded this up and included the code below in case you're interested. My concern is performance and best practices. Circuit Python uses blocking calls such as
time.sleep()
which apparently only blocks the thread and not the entire process. That's great! I coded this example which logs the thread ID for each async message received and callingsleep
on one thread doesn't effect the Socket.io thread.connect
event is called ontime.sleep()
?Thanks! Hope these thoughts make sense! :)
OUTPUT: