Skip to content

hive-router 0.1.0 (2026-08-13)

Choose a tag to compare

@knope-bot knope-bot released this 13 Aug 13:29
32b6f84

Breaking Changes

Fix missing demand control metrics names

Previously added metrics names were missing the hive.router.demand_control. prefix. This has been fixed in this change.

Here's a list of the metrics that have been fixed:

  • cost.estimated -> hive.router.demand_control.cost.estimated
  • cost.actual -> hive.router.demand_control.cost.actual
  • cost.delta -> hive.router.demand_control.cost.delta

Fixes

Allow async fn in the on_http_request plugin hook

RouterPlugin::on_http_request now returns OnHttpRequestHookFuture<'req> instead of OnHttpRequestHookResult<'req> directly, so plugins can await inside - for example calling an upstream auth or feature-flag service - before the rest of the request pipeline runs.

The hook still runs on the same worker thread it started on and is never moved across threads, so the returned future does not need to be Send.

Update any plugin that overrides on_http_request to return a boxed future:

// Before
fn on_http_request<'req>(
    &self,
    payload: OnHttpRequestHookPayload<'req>,
) -> OnHttpRequestHookResult<'req> {
    self.record_request(&payload);
    payload.proceed()
}

// After
fn on_http_request<'req>(
    &'req self,
    payload: OnHttpRequestHookPayload<'req>,
) -> OnHttpRequestHookFuture<'req> {
    Box::pin(async move {
        self.record_request(&payload);
        payload.proceed()
    })
}

If the body reads self inside the async move block, &self needs to become &'req self - the future now holds that borrow for its own lifetime 'req, so the borrow has to be able to live at least that long.

Plugins that don't override on_http_request are unaffected.

See plugin_examples/async_http_fetch for an example that awaits an upstream HTTP call before proceeding.