Skip to content

Make actix-rt (and actix itself) work with tokio console #445

@msdrigg

Description

@msdrigg

When using tokio-console, all tasks run in actix-rt appear meaningless because they look like they are being run from the same line (see image below for illustrations). This issue used to be a tokio issue, but this was just fixed in this pr (tokio-rs/tokio#4483).

Now, have looked into where actix-rt could add "track_caller" attributes to different functions to have the same effect as tokio, but I don't know if this will work due to how actix-rt spawns futures by sending them across channels to arbiters.

At least actix-rt could add track_caller to a few key functions and this would greatly improve usability.

  1. pub fn block_on<F: Future>(&self, fut: F) -> F::Output {
  2. pub fn block_on<F: Future>(&self, fut: F) -> F::Output {
  3. pub fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
  4. pub fn block_on<F>(&self, f: F) -> F::Output
  5. pub fn spawn<Fut>(f: Fut) -> JoinHandle<Fut::Output>

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions