Giter VIP home page Giter VIP logo

Comments (4)

deepbrook avatar deepbrook commented on August 27, 2024 1

I have thought about a LIFO queue as well, however, at this point the library is intentionally rather bare bones. It would technically be no problem to implement this yourself - simply call get() on the Queue and fill it into a deque which then allows you to keep a history of the past X ticks of ticker data.

from btfxwss.

alexeykarnachev avatar alexeykarnachev commented on August 27, 2024

Such approach would cause the memory error because you need to do something with the rest part of messages in queue (not only with the last one)
In other words, you need to consume all messages from subscribed channel.
I think, LIFO could help if only the fixed size of queues will be implemented. Before it's done, you can just do the while loop through all messages in queue and get only the last one

from btfxwss.

ArthurJ avatar ArthurJ commented on August 27, 2024

Yeah, that's what I did. The loop is not a problem.
[ticker_q.get() for _ in range(ticker_q.qsize())][-N:]

The fixed size is necessary indeed, this implementation seems to be useful to client programmers that need the N most recent tickers.

from btfxwss.

deepbrook avatar deepbrook commented on August 27, 2024

With the introduction of zmq in the next release and the deprecation of the current client interface, this issue is no longer relevant.

from btfxwss.

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.