TGViewer
PWRTelegram API channel PWRTelegram API channel @pwrtelegram · 725 subscribers
Post #458 201

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

Fully asynchronous MadelineProto!

MadelineProto now features async, for incredible speed improvements, and parallel processing.
Powered by amphp, MadelineProto wraps the AMPHP APIs to provide a simpler generator-based async API.

What exactly is async, you may ask, and how is it better than threading or multiprocessing?
Async is a relatively new programming pattern that allows you to easily write non-blocking code as if you were using standard blocking functions.


More simply put: with MadelineProto 4.0, each update is handled in parallel using a separate thread, and everything is MUCH faster (even on restricted webhosts; this is perfect for creating file downloader bots!).

To enable async, you have to do two simple things:
1) Load the latest version of MadelineProto
2) yield your method calls.


That's it!
No need to set up thread pools, use synchronization primitives, and so on...
Just yield $MadelineProto->messages->sendMessage instead of $MadelineProto->messages->sendMessage.
More from @pwrtelegram
  1. Oct 17, 2026Introducing MadelineProto 8.8.8, with video calls, group calls, livestreams and end-to-end…
  2. May 11, 2025And then, a long overdue post about my Autonomous System (AS198747), and an over more over…
  3. May 11, 2025The first series of posts I'll be adding here will be some technical deep dives into the p…
  4. May 11, 2025Happy to announce I've launched a blog, where I'll be posting news about all my different…
  5. Aug 25, 2024#FreeDurov.
  6. May 30, 2024MadelineProto was updated! MadelineProto 8.1.0 introduces an official Grafana dashboard fo…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →