Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(subscriber) expose server parts #451

Merged
merged 6 commits into from
Jul 28, 2023
Merged

Commits on Jul 18, 2023

  1. feat(subscriber) expose server parts

    The `ConsoleLayer` builder provides the user with a console layer and
    a server, which is used to start the gRPC server.
    
    However, it may be desireable to expose the instrumentation server together
    with other services on the same Tonic router. This was requested
    explicitly in #428.
    
    Additionally, to add tests which make use of the instrumentation server
    (as part of improving test coverage for #450), more flexibility is
    needed than what is provided by the current API. Specifically we would
    like to connect a client and server via an in memory channel, rather
    than a TCP connection.
    
    This change adds an additional method to `console_subscriber::Server`
    called `into_parts` which allows the user to access the
    `InstrumentServer` directly. A handle which controls the lifetime of the
    `Aggregator` is also provided, as the user must ensure that the
    aggregator lives at least as long as the instrument server.
    
    To facilitate the addition of functionality which would result in more
    "parts" in the future, `into_parts` returns a non-exhaustive struct,
    rather than a tuple of parts.
    
    Closes: #428
    hds committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    758ba9c View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. Apply suggestions from code review

    Co-authored-by: Eliza Weisman <eliza@buoyant.io>
    hds and hawkw committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    1d0213d View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2023

  1. make AggregatorHandle abort explcit

    Instead of aborting the aggregator task upon dropping the
    `AggregatorHandle`, we now provide an explicit `abort` method. If the
    user chooses, they can discard the aggregator handle and while they will
    lose the possibility to clean up the aggregator task, they will be
    otherwise unaffected.
    hds committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    95937c5 View commit details
    Browse the repository at this point in the history
  2. fixed doc link

    hds committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    adca82c View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2023

  1. expose the Aggregator instead of a handle to abort it

    As discussed in code review, for such a low level api as
    `Server::into_parts`, it makes sense to allow the user to spawn the
    aggregator where they like, rather than spawning it internally.
    
    Since I couldn't find a way to return and use a `dyn Future` (boxed or
    otherwise), the `Aggregator` has been made public with a (async) single
    function `run()` which will start it's run loop.
    hds committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    7a2912c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    86b35bb View commit details
    Browse the repository at this point in the history