Skip to content

websocket example not working #206

@koholintian

Description

@koholintian

why doesn't the websocket example work? I get this error: on_message() takes 2 positional arguments but 3 were given

import poloniex
import logging
from time import sleep

logging.basicConfig()
poloniex.logger.setLevel(logging.DEBUG)

def on_volume(data):
print(data)

sock = poloniex.PoloniexSocketed()

sock.startws(subscribe={'24hvolume': on_volume})

sleep(5)

sock.subscribe(chan='ticker', callback=print)
sleep(1)

sock.unsubscribe(1002)
sleep(4)

sock.stopws()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not behaving as it should in the code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy