GithubHelp home page GithubHelp logo

Comments (10)

itsdeka avatar itsdeka commented on August 17, 2024 1

Thanks for the video.
Using 3.9.2 I can reproduce it. Please, consider the possibility of downgrading to 3.8 where this issue does not exist.
I'll try to find a solution.

from bitfinex-api-py.

itsdeka avatar itsdeka commented on August 17, 2024 1

@Bwahharharrr I removed nest_asyncio and found another way.
Can you please give a look? Your example looks good on my end.

https://github.com/bitfinexcom/bitfinex-api-py/pull/180/files

from bitfinex-api-py.

Bwahharharrr avatar Bwahharharrr commented on August 17, 2024 1

@itsdeka Run on my system and the test did indeed subscribe to the 4 tickers opening up 2 separate channels, so that much looks good.
I'll update my end in the next few days and continue using and report back any further related issues but so far looks like good job

alt text

from bitfinex-api-py.

Bwahharharrr avatar Bwahharharrr commented on August 17, 2024

Can you confirm @itsdeka ?

from bitfinex-api-py.

itsdeka avatar itsdeka commented on August 17, 2024

Hello @Bwahharharrr, sorry for the late reply.
I have tried to run your code with websockets 10.0, 9.1 and 8.1 and I have never seen the error described.
Which version of Python are you using? All the other dependencies are as specified in requirementx.txt?

from bitfinex-api-py.

Bwahharharrr avatar Bwahharharrr commented on August 17, 2024

Hi @itsdeka - python version 3.9.2, i just reproduced the test again on an entirely new virtual machine, you can see the log here:
https://asciinema.org/a/LXh9tL4Fgo1z8G26GfLQlocuw

from bitfinex-api-py.

Bwahharharrr avatar Bwahharharrr commented on August 17, 2024

Keen to upgrade rather than downgrade;
I just tested on 3.9.9, same issue/error.

  • Can confirm it does work on 3.8.0

from bitfinex-api-py.

itsdeka avatar itsdeka commented on August 17, 2024

@Bwahharharrr hello, I found a solution to support Py >= 3.9.
Please I'd appreciate if you could confirm that everything works as expected on your end with these changes (#180).

from bitfinex-api-py.

Bwahharharrr avatar Bwahharharrr commented on August 17, 2024

@itsdeka I have run the marketorders branch from your repo with the asyncio_nest code in, which having used before, I thought, 'yes, this will work running this new even loop inside the existing one', however. The code failed to execute properly, and here is why:

As per the original code example provided: It attempts to subscribe to 4 tickers, opening up 2 websockets.
After this nest_asyncio fix, the 2nd websocket connection is at least opening, which is an improvement. HOWEVER.. It never subscribes to the channels.

Python 3.9.2
websockets 9.1
asyncio 3.4.3
nest-asyncio 1.5.1

See here.
image

import os
import sys
from bfxapi import Client, Order

bfx = Client(ws_capacity=3)

tickers = ['tBTCUSD','tETHUSD','tSOLUSD','tLTCUSD']

@bfx.ws.on('connected')
async def blah():
    for t in tickers:
        await bfx.ws.subscribe_trades(t)

@bfx.ws.on('subscribed')
async def subscribed(data):
    print(f"Subscribed to {data.channel_name}, {data.symbol}")

@bfx.ws.on('new_trade')
def log_trade(trade):
    print ("New trade: {}".format(trade))

bfx.ws.run()

from bitfinex-api-py.

itsdeka avatar itsdeka commented on August 17, 2024

Great, thanks for your feedback.
I am on it.

from bitfinex-api-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.