I have created redis pool instance with singleton design pattern in python.
class RedisPool:
pool = None
@classmethod
def get_connection_pool(cls, startup_nodes):
if cls.pool == None:
cls.pool = ConnectionPool(host = startup_nodes['host'], port = startup_nodes['port'], db = 0, password = startup_nodes['password'])
return cls.pool
As I understand from redis documentation we should have single pool instance which is why we use singleton . However one of the flow in python script executes scala script with spark-submit which uses redis connection to dump some data. How can I use same pool instance i have created in python script to use that in scala.