fananimi / pyzk

Unofficial library of zkteco fingerprint attendance machine
GNU General Public License v2.0
489 stars 319 forks source link

Capture Live events from multiple devices #207

Closed Zaeem6100 closed 5 months ago

Zaeem6100 commented 6 months ago

I am creating the microservice to connect with the multiple devices and send that collected data to another server. Is it possible that we can listen events from different devices at same time.

kurenai-ryu commented 6 months ago

sadly the implementation I made (with generators) it should be difficult to connect to multiple devices from the same thread. maybe you can start multiple threads each with a ZK instance running the live-event generator loop. but if you already are working with microservices, better start a new service for each device.

sadly as the asynchronous nature of the live-events, I'm not sure if any other alternative (reimplement with async/await) would help