Skip to content

Extract usage of tokio::runtime::Runtime into our own #1085

@LucioFranco

Description

@LucioFranco

As we move closer to things like async/await and more flexible usage of the tokio runtime. We should provide our own wrappers so that we can easily change out the runtime type in the future. This would mean removing all occurrences of tokio::runtime::Runtime and providing our own spawn function. This should be fairly trivial but would go a long way to improving the experience working with the actual runtime within the codebase. This would also allow us to try other runtimes to see how they impact performance. One example of this is to try out the tokio-io-pool which does less work-stealing and thus might give us better results.

Specification

  • Create our own runtime.rs that contains a Runtime struct and a free spawn fn. These should generally wrap around the tokio runtime.
  • Replace ALL usage of tokio::runtime::Runtime throughout the codebase. We may also at this point want to move in test_utils::runtime to be a fn that lives within create::runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain: topologyAnything related to Vector's topology codegood first issueAnything that is good for new contributors.type: enhancementA value-adding code change that enhances its existing functionality.type: tech debtA code change that does not add user value.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions