Sync frames using gevent events
This commit is contained in:
parent
d098af8858
commit
2bc02b3844
1 changed files with 2 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import time
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import threading
|
import threading
|
||||||
|
import gevent.event
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
@ -61,7 +62,7 @@ class CameraEvent(object):
|
||||||
# this is a new client
|
# this is a new client
|
||||||
# add an entry for it in the self.events dict
|
# add an entry for it in the self.events dict
|
||||||
# each entry has two elements, a threading.Event() and a timestamp
|
# each entry has two elements, a threading.Event() and a timestamp
|
||||||
self.events[ident] = [threading.Event(), time.time()]
|
self.events[ident] = [gevent.event.Event(), time.time()]
|
||||||
return self.events[ident][0].wait(timeout)
|
return self.events[ident][0].wait(timeout)
|
||||||
|
|
||||||
def set(self):
|
def set(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue