[PATCH] Allow probes references in VCL and VMODs

Dridi Boukelmoune dridi at varni.sh
Tue Jun 16 16:27:29 CEST 2015


On Tue, Jun 16, 2015 at 3:27 PM, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
> --------
> In message <CABoVN9Cj8Cadbpv7XCCDM7D2VzuScx90LkQAh-itPL3qc7T-jw at mail.gmail.com>
> , Dridi Boukelmoune writes:
>
>>Continuing on the dynamic backends track, here is a patch to allow
>>manipulation of probes. It is not usable yet, but will hopefully be
>>soon.
>
> Please say a little bit more or write a mock-up VCL ?

Sure, it will allow dynamic backends to have probes, and not force
vmod writers to build the probes themselves (but they could too,
probes have been miniojb'd). A vmod building a dynamic backend
could use a native VCL static probe.

--->8-------->8-------->8-------->8-------->8-------->8---
import std;
import vmod;

probe www_probe {
   ...
}

sub vcl_init {
  new dir = vmod.construct(..., www_probe);
}

sub vcl_recv {
  set req.backend_hint = dir.backend();
}

sub vcl_hit {
  if (std.healthy(req.backend_hint)) {
    ...
  }
}
--->8-------->8-------->8-------->8-------->8-------->8---



More information about the varnish-dev mailing list