Scheduler first commit
This commit is contained in:
parent
70c53a9aef
commit
2c64ebda67
24 changed files with 880 additions and 0 deletions
8
examples/schedule/schedule_lib/singleton.py
Normal file
8
examples/schedule/schedule_lib/singleton.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from abc import ABCMeta
|
||||
|
||||
class Singleton(ABCMeta):
|
||||
_instances = {}
|
||||
def __call__(cls, *args, **kwargs):
|
||||
if cls not in cls._instances:
|
||||
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
|
||||
return cls._instances[cls]
|
||||
Loading…
Add table
Add a link
Reference in a new issue