1
0
Files
electrum/electrum
SomberNight 45e08ada61 lnpeer: make process_message async
This allows making any message handler async in lnpeer.

Note: `process_message` is only called from `_message_loop`.
There are(would be) basically three types of message handlers:
1. "traditional blocking msg handlers". non-async ones. When these handlers are called, `process_message` naturally blocks until the handler returns, which means `_message_loop` also blocks until the message is fully processed before starting the next iteration.
2. "async blocking msg handlers". async ones where we want the previous property, i.e. we want the `_message_loop` to wait until the handler finishes. We await the handler inside `process_message`, and `_message_loop` awaits `process_message`.
3. "async non-blocking msg handlers". async message handlers that can be spawned e.g. onto `Peer.taskgroup` and the loop is free to start processing subsequent messages. e.g. msg handlers that start a negotiation, such as `on_shutdown` and `on_open_channel`.

Any non-async message handler (`def on_...`) automatically goes into category 1.
An async message handler, by default, goes into category 2, "blocking";
to go into category 3 ("non-blocking"), we use the `runs_in_taskgroup` function decorator.
2024-02-15 11:20:49 +00:00
..
2023-11-13 10:47:18 +01:00
2022-07-07 18:29:01 +02:00
2022-10-20 18:43:54 +00:00
2023-06-01 22:59:40 +00:00
2023-09-09 14:14:43 +02:00
2023-04-24 12:58:01 +00:00
2023-12-22 11:03:58 +01:00
2023-04-24 12:58:01 +00:00
2024-02-12 18:26:08 +00:00
2024-01-22 03:27:17 +00:00
2023-02-17 11:43:11 +00:00
2024-02-15 11:20:49 +00:00
2021-07-15 14:52:25 +00:00
2023-10-27 16:01:23 +00:00
2023-02-17 11:43:11 +00:00
2023-02-17 11:43:11 +00:00
2024-01-22 03:27:20 +00:00
2021-03-21 00:36:23 -04:00
2022-10-31 16:13:22 +00:00
2023-04-24 12:58:26 +00:00
2022-10-31 16:13:22 +00:00
2022-11-18 23:13:25 +01:00
2023-04-19 22:31:08 +00:00
2023-12-04 14:15:39 +08:00
2023-05-25 17:39:48 +00:00
2024-01-19 16:23:24 +00:00
2024-02-12 18:26:08 +00:00
2024-02-13 14:52:52 +00:00