deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

tokio console support for core and repl tool

Open Simon-Laux opened this issue 1 year ago • 1 comments

attached to repl tool: Bildschirmfoto 2024-10-03 um 09 53 16 Bildschirmfoto 2024-10-03 um 09 54 05

attached to dc-desktop: Bildschirmfoto 2024-10-03 um 11 07 55

  • [x] add tokio console support to repl tool
  • [x] create a readme for the repl tool
  • [x] name tasks in repl tool and in core
  • [x] add console-subscriber to the deltachat-rpc-server, this allows debugging in desktop and bots that use the rpc server.
  • [x] Label Handle::current().spawn_blocking tasks after I know why it uses Handle::current().spawn_blocking instead of just tokio::task::spawn_blocking
  • [x] Figure out how to address cargo deny report

The named tasks are useful also in other projects that depend on deltachat core, like bots written in rust.

I'm not sure whether there is a benefit of adding a new cargo feature to conditionally depend on console-subscriber. I think the tokio_unstable rustflag is enough of a toggle switch.

successor of #4418

Simon-Laux avatar Oct 03 '24 06:10 Simon-Laux

I haven't thought much about naming conventions for the tasks yet, currently is is rather inconsistent in some places.

I prefixed the tasks for the REPL with repl::, but haven't done so for core, maybe dc:: could be a good prefix?

Things to consider:

  • unless you have a wide terminal only first chars of name are shown in the table view.
  • there is a column with source location, so maybe name doesn't need full location info?
  • should tasks have "loop" in their name?

Simon-Laux avatar Oct 03 '24 07:10 Simon-Laux

Let's move this to project resurrection for now. It is possible to rebase and fix conflicts later as most conflicts are about imports, but this can be done when someone actually has a need for this e.g. for debugging something (like iroh, afaik they actually use it because iroh spawns a lot of tasks, while in the core we only have a few loops).

link2xt avatar Oct 13 '25 12:10 link2xt