Giter Site home page Giter Site logo

Comments (12)

iamDonkey avatar iamDonkey commented on July 24, 2024

I also want it🀯

from ll-mtproto.

andrew-ld avatar andrew-ld commented on July 24, 2024

@iamDonkey I'm trying to find a solution but I'm not finding an easy way.

from ll-mtproto.

andrew-ld avatar andrew-ld commented on July 24, 2024

a8fa5f2#diff-184fc5e51edee9e0cbe93c22165b2e4809c9279ea8d645de86630af29a75c751R378

if you look i made the way that the non deserialized body is read in the main thread, now it should be done that the second schema.read (the one under the todo) is done in another thread, the problem is that the deserializer is asynchronous so i should start another async loop on another thread and i don't like that my library does it internally, it could lead to leaks.

from ll-mtproto.

andrew-ld avatar andrew-ld commented on July 24, 2024

@iamDonkey you can try the mt_body_deserialize branch, I have implemented a multithreaded deserialiser, you can let me know if it works well for you

from ll-mtproto.

andrew-ld avatar andrew-ld commented on July 24, 2024

#5

from ll-mtproto.

iamDonkey avatar iamDonkey commented on July 24, 2024

hi @andrew-ld i don't know how to test it but right now master branch seems to be broken.

ERROR:root:failure while read message from mtproto: Traceback (most recent call last):
  File "/root/LL-mtproto-master/ll_mtproto/client.py", line 258, in _mtproto_loop
    message = await mtproto_link.read()
  File "/root/LL-mtproto-master/ll_mtproto/network/mtproto.py", line 332, in read
    auth_key, auth_key_id = await self._get_auth_key()
  File "/root/LL-mtproto-master/ll_mtproto/network/mtproto.py", line 170, in _get_auth_key
    await self._create_auth_key()
  File "/root/LL-mtproto-master/ll_mtproto/network/mtproto.py", line 190, in _create_auth_key
    new_nonce, (p, q) = await asyncio.gather(
  File "/root/LL-mtproto-master/ll_mtproto/network/mtproto.py", line 134, in _in_thread
    return await self._loop.run_in_executor(self._executor, *args, **kwargs)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/root/LL-mtproto-master/ll_mtproto/math/primes.py", line 7, in factorize
    return cryptg.factorize_pq_pair(pq)
AttributeError: module 'cryptg' has no attribute 'factorize_pq_pair'

from ll-mtproto.

andrew-ld avatar andrew-ld commented on July 24, 2024

@iamDonkey is not broken, you have to update the dependencies.

pip3 install -U -r requirements.txt

from ll-mtproto.

iamDonkey avatar iamDonkey commented on July 24, 2024

from ll-mtproto.

andrew-ld avatar andrew-ld commented on July 24, 2024

because the other branch does not use cryptg.factorize_pq_pair, make sure you have cryptg 0.3 installed.

from ll-mtproto.

iamDonkey avatar iamDonkey commented on July 24, 2024

from ll-mtproto.

iamDonkey avatar iamDonkey commented on July 24, 2024

hi @andrew-ld , i am trying to call a method concurrently/parallel request using asyncio.gather(*array of function) but if i check responses received time its like sequential.
is it the right way of calling method concurrently?

from ll-mtproto.

andrew-ld avatar andrew-ld commented on July 24, 2024

@iamDonkey

multiple_requests_test = await session.rpc_call_multi([

from ll-mtproto.

Related Issues (9)

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.