RFC: unify directors and backends vcl interface

Dridi Boukelmoune dridi at varni.sh
Wed Sep 19 17:08:47 UTC 2018


On Wed, Sep 19, 2018 at 12:19 PM Nils Goroll <slink at schokola.de> wrote:
>
> my example was missing the point
>
> On 19/09/2018 12:14, Nils Goroll wrote:
> > backend "b" which you now want to layer under director "d": all instances of "b"
> > in the vcl now need to be replaced with something like "d.backend()".
>
> ... while, if we had a common accessor, b could be renamed to bb and the
> director be called b.

That won't work when .backend() takes arguments *cough* hash *cough*.

I think the confusion is mostly that we make an amalgam of the VMOD
object and the underlying director. I'm not strictly against adding some
magic to VCL, in this case saying that having a no-arg method returning
a VCL_BACKEND could be used automagically when casting an
"expression" to a backend and even enforce that the name of the no-arg
method is .backend().

I suggested in the past that "vmod-object ~ arg" syntax could automatically
be turned into "vmod-object.match(arg)" when we have a matching (pun
intended) "BOOL .match(SINGLE-ARG)" method.

In case it's not clear, I think it's a good idea, and I'm merely discussing
caveats to consider. Mainly, disambiguation.

Dridi


More information about the varnish-dev mailing list