Giter Site home page Giter Site logo

Zenbot hanging about zenbot HOT 5 OPEN

arthurwolf avatar arthurwolf commented on August 27, 2024
Zenbot hanging

from zenbot.

Comments (5)

arthurwolf avatar arthurwolf commented on August 27, 2024

it's starting to look like this is a weird re-entry issue.

why is getNext() an async function but await isn't used when it's called?

from zenbot.

arthurwolf avatar arthurwolf commented on August 27, 2024

a dirty fix to this was to change limit: 100 to limit: 100000000, it now works 100% of the time
it also had a weird side effect: execution of simulations is MASSIVELY faster
why was this limited to 100, was this built to be executed on a raspberry pi originally or something like that? it's a very small limit...
or maybe there's an operational reason why you need to do it by small groups? the reverse/symmetry thing?

from zenbot.

arthurwolf avatar arthurwolf commented on August 27, 2024

note: setting limit to very high values does not solve the issue, it just makes it much much more difficult to reproduce
also, setting limit to 5 makes it much easier to reproduce

from zenbot.

arthurwolf avatar arthurwolf commented on August 27, 2024

Replacing most of the getNext() function with simply:

    let cur = tradesCollection.find(opts.query).sort(opts.sort);
    let results = await cur.toArray();
    results.forEach((trade, i) => {eventBus.emit('trade', trade)});
    engine.exit(exitSim);

functions great (so far...)
I'm loosing the "reverse" feature, which I don't use/understand. If I understood what it is maybe I could re-implement it, will look into it.

from zenbot.

arthurwolf avatar arthurwolf commented on August 27, 2024

Down to two lines, works perfectly. Doesn't have the "symmetry" feature, but I don't understand that well enough to implement it. Any explanations welcome:

        await tradesCollection.find(opts.query).batchSize(10).sort(opts.sort).forEach((trade, i) => {eventBus.emit('trade', trade)});
        engine.exit(exitSim);

from zenbot.

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.