Skip to content

'PusherAsyncClient' object has no attribute 'connection' #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ignacio-diaz opened this issue Sep 14, 2020 · 0 comments
Open

'PusherAsyncClient' object has no attribute 'connection' #2

ignacio-diaz opened this issue Sep 14, 2020 · 0 comments

Comments

@ignacio-diaz
Copy link

Hi!

I have a problem and I don't know how to fix it..

when I try to subscrive to a public pusher, like
status = await pusherclient.subscribe(channel_name='prod-{}'.format(asdf))
print("Subscription Status: %s"%(status))

it works perfecly, but when I try to subscrive to a private channel, like this
status = await pusherclient.subscribe(channel_name='private-{}'.format(lalala))
print("Subscription Status: %s"%(status))

It sends me an error
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/nacho/.vscode/extensions/ms-python.python-2020.8.108011/pythonFiles/lib/python/debugpy/main.py", line 45, in
cli.main()
File "/home/nacho/.vscode/extensions/ms-python.python-2020.8.108011/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/home/nacho/.vscode/extensions/ms-python.python-2020.8.108011/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 267, in run_file
runpy.run_path(options.target, run_name=compat.force_str("main"))
File "/usr/lib/python3.8/runpy.py", line 263, in run_path
return _run_module_code(code, init_globals, run_name,
File "/usr/lib/python3.8/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/nacho/Escritorio/PyOx/trades/orionTrades.py", line 122, in
loop.run_until_complete(bitstamp_ob_subscription(loop))
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/nacho/Escritorio/PyOx/trades/orionTrades.py", line 93, in bitstamp_ob_subscription
status = await pusherclient.subscribe(channel_name='private-{}'.format(lalala))
File "/home/nacho/.local/lib/python3.8/site-packages/pysherasync/pysherasync.py", line 78, in subscribe
data['auth'] = self._generate_auth_token(channel_name)
File "/home/nacho/.local/lib/python3.8/site-packages/pysherasync/pysherasync.py", line 114, in _generate_auth_token
subject = "{}:{}".format(self.connection.socket_id, channel_name)
AttributeError: 'PusherAsyncClient' object has no attribute 'connection'

What am I missing?

Regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant