Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working threads #4

Closed
leda-ferreira opened this issue Aug 10, 2016 · 14 comments
Closed

Working threads #4

leda-ferreira opened this issue Aug 10, 2016 · 14 comments

Comments

@leda-ferreira
Copy link

First, thank you for this awesome project ! I'll look forward to contribute very soon :-).
That said, I would like to suggest using a library such as ReactPHP, Icicle.io or equivalent in order to permit assynchronous, non-blocking I/O. I think that, since the project its still in the beginning, this change wouldn't impact too much. I can try to work this into the code if necessary.

@danog
Copy link
Owner

danog commented Aug 10, 2016

That sounds like a good idea, even if I don't see exactly how can sending/receiving mtproto requests asynchronously improve speed or efficiency.
I might work it into the code later, as soon as I fix the generation of the authorization key.

@leda-ferreira
Copy link
Author

Actually the non-blocking async i/o is to allow integration of your code with existing systems such as websocket servers / clients etc.
But thank you very much for considering the idea :-)

@danog
Copy link
Owner

danog commented Mar 14, 2017

Implementing threads atm, will take a while, but this will allow the creation of a fast socket wrapper.

@vahidvdn
Copy link

@danog Would you please explain more about threads atm?

@danog
Copy link
Owner

danog commented Mar 14, 2017

kek
threads = PHP threading here's a nice writeup
atm = at the moment

@danog danog changed the title non-blocking I/O Working threads Oct 17, 2017
@danog
Copy link
Owner

danog commented Oct 17, 2017

This will only work when the dev of pthreads fixes bugs with nested volatile objects, and the devs of php fix https://bugs.php.net/bug.php?id=74545 (workarounds slow down everything too much)

@danog
Copy link
Owner

danog commented Oct 17, 2017

@danog
Copy link
Owner

danog commented Mar 3, 2018

The latest version now supports multiprocessing with pcntl_fork.
It's not threading, but at least it's something.

@albedev
Copy link

albedev commented Mar 3, 2018

@danog Nice

@danog
Copy link
Owner

danog commented Nov 28, 2018

Finally implemented async in the alpha branch

@danog danog added this to the MadelineProto 4.0 milestone Nov 28, 2018
@giuseppeM99
Copy link
Contributor

async != threaded

@danog
Copy link
Owner

danog commented Nov 28, 2018

But async is what OP originally proposed to implement :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants