Skip to content

Commit

Permalink
refactored to create a new Channel for each client.connect execution #…
Browse files Browse the repository at this point in the history
  • Loading branch information
hokiegeek2 authored Jun 20, 2023
1 parent eeebe70 commit f417c43
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions arkouda/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def disconnect(self) -> None:
def get_channel(server: str = 'localhost', port: int = 5555, token: str = None,
connect_url: str = None) -> Channel:
"""
Returns the configured Channel implementation, instantiating it if None
Returns the configured Channel implementation
Parameters
----------
Expand All @@ -497,14 +497,11 @@ def get_channel(server: str = 'localhost', port: int = 5555, token: str = None,
EnvironmentError
Raised if the ARKOUDA_CHANNEL_TYPE references an invalid ChannelType
"""
def establish_channel() -> Channel:
if channelType == ChannelType.ZMQ:
return ZmqChannel(server=server, port=port, user=username, token=token,
connect_url=connect_url)
else:
raise EnvironmentError(f'Invalid channelType {channelType}')

return channel if channel else establish_channel()
if channelType == ChannelType.ZMQ:
return ZmqChannel(server=server, port=port, user=username, token=token,
connect_url=connect_url)
else:
raise EnvironmentError(f'Invalid channelType {channelType}')


def connect(
Expand Down

0 comments on commit f417c43

Please sign in to comment.