TGViewer
MadelineProto | Official Channel MadelineProto | Official Channel @madelineproto · 6.42K subscribers
Post #443 3.24K
And now, let's elaborate on async:
With MadelineProto 4.0, each update is handled in parallel using a separate thread, and everything is done in parallel (even on restricted webhosts, perfect for creating file downloader bots!).

When I say thread, I actually mean green thread (wikipedia), often called strand.

Strands are behave exactly like normal threads, except that they're implemented in user-space, and they're much faster, more reliable, and do not suffer from synchronization issues present with normal threads.

Each update you receive using the event handler or the callback handler is managed in parallel in separate green threads: the only thing you have to do to enable async with green threads is add a yield before calling MadelineProto methods.

Full async documentation with examples.

If your code still relies on the old synchronous behaviour, don't worry, there is backward compatibility.
However, old synchronous behaviour is deprecated, and I highly recommend you switch to async, due to the huge performance and parallelism benefits.
More from @madelineproto
  1. Oct 17, 2026Introducing MadelineProto 8.8.8, with video calls, group calls, livestreams and end-to-end…
  2. Oct 17, 2026Introducing MadelineProto 8.8.8, with video calls, group calls, livestreams and end-to-end…
  3. Jul 26, 2026Native, pure-PHP (no FFI, no shell, 💯 webhost support) group and video calls are working…
  4. Jun 16, 2026MadelineProto may also be affected if your upstreams aren't filtering invalid routes via R…
  5. Jun 16, 2026Indeed, looking at the announced routes i.e. in https://bgp.he.net/AS18101#_prefixes + htt…
  6. Jun 16, 2026⚠️ Indian telecom Reliance is sabotaging access to Telegram for millions of users OUTSIDE…
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 →