Skip to content

Commit

Permalink
subscriber: add MakeWriter combinators (#1274)
Browse files Browse the repository at this point in the history
This backports #1274 from `master`.

Depends on #1141.

This branch adds a `MakeWriterExt` trait which adds a number of
combinators for composing multiple types implementing `MakeWriter`.
`MakeWriter`s can now be teed together, filtered with minimum and
maximum levels, filtered with a `Metadata` predicate, and combined with
a fallback for when a writer is _not_ made for a particular `Metadata`.

I've also added a `MakeWriter` impl for `Arc<W>` when `&W` implements
`Write`. This enables `File`s to be used as `MakeWriter`s similarly to
how we will be able to in 0.3, with the additional overhead of having to
do ref-counting because we can't return a reference from `MakeWriter`
until the next breaking change.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw committed Jun 25, 2021
1 parent bf8d026 commit 6def3c5
Show file tree
Hide file tree
Showing 3 changed files with 958 additions and 44 deletions.
Loading

0 comments on commit 6def3c5

Please sign in to comment.