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.
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.