Git Product home page Git Product logo

Comments (8)

LordOfPolls avatar LordOfPolls commented on August 17, 2024 2

@silasary

Reading the code, I'm not convinced this is accurate.

My theory to the cause was based on the wrapping process. The library literally wraps objects and uses the current client as a param. Figuratively owning the object.

I believe there are other issues resulting in the behaviour I've found, but I've yet to have time to debug further so I reported what I had found so far.

End of the day the lib wasn't written with multi-instancing in mind, so a few changes are required. Shouldn't be too bad, just annoying

But either way we spin it, more testing is needed to determine the cause of the behaviour. As I'll admit, I'm theorising

from naff.

silasary avatar silasary commented on August 17, 2024 1

Currently waiting on #346 before more progress can be made here

from naff.

i0bs avatar i0bs commented on August 17, 2024

Is there any prio status on this, or labeling? I'm currently having issues making this work as well, there's only one main heartbeater and other instantiations of the client fail to create others respectively. Adding a __new__ magic for this would be very convenient with IPC-based solutions.

from naff.

LordOfPolls avatar LordOfPolls commented on August 17, 2024

So, it can be done without to much pain, the downside is there isnt a public method to make it work. Please excuse the ugly test code

tokens = [...]
bots = []

for token in tokens:
    _bot = Snake()
    bots.append(_bot)
    print(f"Logging in with {token}")
    loop.run_until_complete(_bot.login(token))
    print(_bot.user.username)


print(f"Attempting to start {len(bots)} gateways")
loop.run_until_complete(asyncio.gather(*[b.start_gateway() for b in bots]))

This will create n number of bots and connect them all, however the issue arrises that the bot instances attempt to own listeners, meaning one bot will get all events. In real terms this means if you run a command, one bot will respond twice, meanwhile the other bot wont do anything, this is fixable, but not ideal.

from naff.

KAJdev avatar KAJdev commented on August 17, 2024

could this be sorta monkey-patched by not using @listen() decorators and manually registering them?

from naff.

silasary avatar silasary commented on August 17, 2024

bot instances attempt to own listeners, meaning one bot will get all events.

Reading the code, I'm not convinced this is accurate.

by not using @listen() decorators and manually registering them?

You'd need to convert them into listeners to register them anyway.

from naff.

KAJdev avatar KAJdev commented on August 17, 2024

Any movement on this?

from naff.

LordOfPolls avatar LordOfPolls commented on August 17, 2024

We are now working on this... it is suffering incarnate

from naff.

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.