Skip to content

Releases: tower-rs/tower

Tower 0.4.8

28 May 20:21
b5d2c8f
Compare
Choose a tag to compare

Added

  • builder: Add ServiceBuilder::map_result analogous to
    ServiceExt::map_result (#583)
  • limit: Add GlobalConcurrencyLimitLayer to allow reusing a concurrency
    limit across multiple services (#574)

Tower 0.4.6

27 Feb 13:07
4fb257c
Compare
Choose a tag to compare

Deprecated

  • util: Deprecated ServiceExt::ready_and (renamed to
    ServiceExt::ready). (#567)
  • util: Deprecated ReadyAnd future (renamed to Ready). (#567)

Added

  • builder: Add ServiceBuilder::layer_fn to add a layer built from
    a function. (#560)
  • builder: Add ServiceBuilder::map_future for transforming the
    futures produced by a service. (#559)
  • builder: Add ServiceBuilder::service_fn for applying Layers to
    an async function using util::service_fn. (#564)
  • util: Add example for service_fn. (#563)
  • util: Add BoxLayer for creating boxed Layer trait objects.
    (#569)

Tower 0.4.5

27 Feb 13:06
ba3d431
Compare
Choose a tag to compare

Added

  • util: Add ServiceExt::map_future. (#542)
  • builder: Add ServiceBuilder::option_layer to optionally add a layer. (#555)
  • make: Add Shared which lets you implement MakeService by cloning a
    service. (#533)

Fixed

  • util: Make combinators that contain closures implement Debug. They
    previously wouldn't since closures never implement Debug. (#552)
  • steer: Implement Clone for Steer. (#554)
  • spawn-ready: SpawnReady now propagates the current tracing span to
    spawned tasks (#557)
  • Only pull in tracing for the features that need it. (#551)

Tower 0.4.4

20 Jan 15:23
886f72a
Compare
Choose a tag to compare

Added

  • util: Implement Layer for Either<A, B>. (#531)
  • util: Implement Clone for FilterLayer. (#535)
  • timeout: Implement Clone for TimeoutLayer. (#535)
  • limit: Implement Clone for RateLimitLayer. (#535)

Fixed

  • Added "full" feature which turns on all other features. (#532)
  • spawn-ready: Avoid oneshot allocations. (#538)

Tower 0.4.3

13 Jan 21:27
5ad1757
Compare
Choose a tag to compare

Added

  • filter: Filter::check and AsyncFilter::check methods which check a
    request against the filter's Predicate (#521)
  • filter: Added get_ref, get_mut, and into_inner methods to Filter
    and AsyncFilter, allowing access to the wrapped service (#522)
  • util: Added layer associated function to AndThen, Then,
    MapRequest, MapResponse, and MapResult types. These return a Layer
    that produces middleware of that type, as a convenience to avoid having to
    import the Layer type separately. (#524)
  • util: Added missing Clone impls to AndThenLayer, MapRequestLayer,
    and MapErrLayer, when the mapped function implements Clone (#525)
  • util: Added FutureService::new constructor, with less restrictive bounds
    than the future_service free function (#523)

tower-layer 0.3.1

07 Jan 23:07
44ad621
Compare
Choose a tag to compare

Added

  • Added layer_fn, for constructing a Layer from a function taking
    a Service and returning a different Service (#491)
  • Added an implementation of Layer for &Layer (#446)
  • Multiple documentation improvements (#487, #490)

Tower 0.4.1

07 Jan 23:29
b447771
Compare
Choose a tag to compare

This is a hotfix for missing re-exports due to an insufficiently restrictive
dependency version for tower-layer.

Fixed

  • Updated tower-layer to 0.3.1 to fix broken re-exports.

Tower 0.4.0

07 Jan 22:43
ca685ae
Compare
Choose a tag to compare

This is a major breaking release including a large number of changes. In
particular, this release updates tower to depend on Tokio 1.0, and moves all
middleware into the tower crate. In addition, Tower 0.4 reworks several
middleware APIs, as well as introducing new ones.

This release does not change the core Service or Layer traits, so tower
0.4 still depends on tower-service 0.3 and tower-layer 0.3. This means that
tower 0.4 is still compatible with libraries that depend on those crates.

Added

  • make: Added MakeService::into_service and MakeService::as_service for
    converting MakeServices into Services (#492)
  • steer: Added steer middleware for routing requests to one of a set of
    services (#426)
  • util: Added MapRequest middleware and ServiceExt::map_request, for
    applying a function to a request before passing it to the inner service
    (#435)
  • util: Added MapResponse middleware and ServiceExt::map_response, for
    applying a function to the Response type of an inner service after its
    future completes (#435)
  • util: Added MapErr middleware and ServiceExt::map_err, for
    applying a function to the Error returned by an inner service if it fails
    (#396)
  • util: Added MapResult middleware and ServiceExt::map_result, for
    applying a function to the Result returned by an inner service's future
    regardless of whether it succeeds or fails (#499)
  • util: Added Then middleware and ServiceExt::then, for chaining another
    future after an inner service's future completes (with a Response or an
    Error) (#500)
  • util: Added AndThen middleware and ServiceExt::and_then, for
    chaining another future after an inner service's future completes successfully
    (#485)
  • util: Added layer_fn, for constructing a Layer from a function taking
    a Service and returning a different Service (#491)
  • util: Added FutureService, which implements Service for a
    Future whose Output type is a Service ([#496])
  • util: Added BoxService::layer and UnsyncBoxService::layer, to make
    constructing layers more ergonomic (#503)
  • layer: Added Layer impl for &Layer (#446)
  • retry: Added Retry::get_ref, Retry::get_mut, and Retry::into_inner
    to access the inner service (#463)
  • timeout: Added Timeout::get_ref, Timeout::get_mut, and
    Timeout::into_inner to access the inner service (#463)
  • buffer: Added Clone and Copy impls for BufferLayer (#493)
  • Several documentation improvements (#442, #444, #445, #449, #487,
    #490, #506])

Changed

  • All middleware tower-* crates were merged into tower and placed
    behind feature flags (#432)
  • Updated Tokio dependency to 1.0 (#489)
  • builder: Make ServiceBuilder::service take self by reference rather
    than by value (#504)
  • reconnect: Return errors from MakeService in the response future, rather than
    in poll_ready, allowing the reconnect service to be reused when a reconnect
    fails (#386, #437)
  • discover: Changed Discover to be a sealed trait alias for a
    TryStream<Item = Change>. Discover implementations are now written by
    implementing Stream. (#443)
  • load: Renamed the Instrument trait to TrackCompletion (#445)
  • load: Renamed NoInstrument to CompleteOnResponse (#445)
  • balance: Renamed BalanceLayer to MakeBalanceLayer (#449)
  • balance: Renamed BalanceMake to MakeBalance (#449)
  • ready-cache: Changed ready_cache::error::Failed's fmt::Debug impl to
    require the key type to also implement fmt::Debug (#467)
  • filter: Changed Filter and Predicate to use a synchronous function as
    a predicate (#508)
  • filter: Renamed the previous Filter and Predicate (where Predicates
    returned a Future) to AsyncFilter and AsyncPredicate (#508)
  • filter: Predicates now take a Request type by value and may return a
    new request, potentially of a different type (#508)
  • filter: Predicates may now return an error of any type (#508)

Fixed

  • limit: Fixed an issue where RateLimit services do not reset the remaining
    count when rate limiting (#438, [#439])
  • util: Fixed a bug where oneshot futures panic if the service does not
    immediately become ready (#447)
  • ready-cache: Fixed ready_cache::error::Failed not returning inner error types
    via Error::source (#467)
  • hedge: Fixed an interaction with buffer where buffer slots were
    eagerly reserved for hedge requests even if they were not sent (#472)
  • hedge: Fixed the use of a fixed 10 second bound on the hedge latency
    histogram resulting on errors with longer-lived requests. The latency
    histogram now automatically resizes (#484)
  • buffer: Fixed an issue where tasks waiting for buffer capacity were not
    woken when a buffer is dropped, potentially resulting in a task leak (#480)

Removed

  • Remove ServiceExt::ready.
  • discover: Removed discover::stream module, since Discover is now an
    alias for Stream (#443)
  • buffer: Removed MakeBalance::from_rng, which caused all balancers to use
    the same RNG (#497)