andreped commited on
Commit
4a01db9
·
1 Parent(s): 780a89e

Implemented singleton to allow shared memory between sessions

Browse files
Files changed (1) hide show
  1. postly/clients/singleton_client.py +10 -0
postly/clients/singleton_client.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from .postly_client import PostlyClient
2
+
3
+ class SingletonPostlyClient:
4
+ _instance = None
5
+
6
+ @staticmethod
7
+ def get_instance():
8
+ if SingletonPostlyClient._instance is None:
9
+ SingletonPostlyClient._instance = PostlyClient()
10
+ return SingletonPostlyClient._instance