Skip to content

Change std::timer functions to not require a passed-in uv::global_loop #4385

Closed
@bstrie

Description

@bstrie
< bstrie> is there a reason that you must manually do `uv::global_loop::get()`
          in order to use std::timer::sleep?
< bstrie> feels like that could just as easily live in the sleep function
<@brson> bstrie: yes, the interface needs a redesign
<@brson> if you want to subit the patch that hides the loop from all the timer
         functions that would be fine
<@brson> i did at one point expect to have both, one that takes the loop and one
         that uses the default loop, but maybe it doesn't matter
< bstrie> brson: is it expensive to look up the loop every time? would callers
          benefit from only calling uv::global_loop::get() once and then passing
          that around to all their timer functions?
<@brson> bstrie: it is not particularly expensive to get the loop. the message
         passing and scheduling involved is more expensive

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions