Skip to content

Conversation

Dav1dde
Copy link
Member

@Dav1dde Dav1dde commented Feb 18, 2025

The goal: Generically track a utilization metric (and more) for each service spawned in Relay.

To make this possible relay-system's Runtime and Handle have gained the possibility to spawn services. Now instead of instantiating a ServiceRunner services are spawned through the runtime.

The runtime has now a registry for all spawned services, which allows enumerating all currently running services as well as querying their tracked metrics.

To make testing not abysmal, a ServiceSpawn trait was introduced, tests can spawn services on the Tokio Runtime using TokioServiceSpawn.

This is also a great foundation to finally move the graceful shutdown handling properly into the service framework instead of relying on a global.

@Dav1dde Dav1dde force-pushed the dav1d/service-util branch 2 times, most recently from 557cb6b to aaf19e7 Compare February 19, 2025 10:23
@Dav1dde Dav1dde force-pushed the dav1d/service-util branch 2 times, most recently from b8475c5 to 9b45650 Compare February 19, 2025 10:50
@Dav1dde Dav1dde marked this pull request as ready for review February 19, 2025 10:50
@Dav1dde Dav1dde requested a review from a team as a code owner February 19, 2025 10:50
@Dav1dde Dav1dde self-assigned this Feb 19, 2025
Copy link
Contributor

@Litarnus Litarnus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Dav1dde Dav1dde enabled auto-merge (squash) February 21, 2025 07:06
@Dav1dde Dav1dde merged commit e0e55e7 into master Feb 21, 2025
25 checks passed
@Dav1dde Dav1dde deleted the dav1d/service-util branch February 21, 2025 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants