[PATCH] add documentation about backend naming for VMOD authors

Geoff Simmons geoff at uplex.de
Sun Nov 1 22:04:28 CET 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 11/01/2015 07:01 PM, Dridi Boukelmoune wrote:
> 
> We had sort-of started a discussion on IRC at some point about
> that, but there's no way AFAIK to enforce namespaces. This is why
> in this doc I suggest to back backends with a VMOD object, in order
> to get a vcl_name from the compiler and reuse it.

I should have pointed out that the doc-patch mentions the function
VCL_HasBackend(), which would come from another patch earlier in the
thread. So that part of the new docs should come if and when the code
patch is also added. VCL_HasBackend() tells you if a backend name is
already in use by a VCL.

The one object/one backend solution can help you with that as well,
but it depends on what you want your VMOD to do. I have a VMOD in the
works for creating new backends at runtime, and that won't work by
creating new objects for every backend, since objects can only be
created in vcl_init.

But it does have something similar to what you said, Dridi -- the VMOD
uses PRIV_VCL arguments to keep track of the backends that it created,
and then you can get the backends back (for req.backend_hint etc.)
with a function by_name("backend_name") that returns VCL_BACKEND.


Best,
Geoff
- -- 
** * * UPLEX - Nils Goroll Systemoptimierung

Scheffelstraße 32
22301 Hamburg

Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753

http://uplex.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJWNn5cAAoJEOUwvh9pJNURGNkP/RtLN4yfHqoKfAfMHOU8FRvp
86l/avbcrfaLEoUFBs3TJrhPQboX0Q0/4HovZJbpg4qVJTIoAixKL3f+P9Pwgd4h
EbLxSeQUvn+R2tc7e1Y/6+2OVsBC4gsyx/Sy/9+TJZfAZRth7XDM+X8YoPyQj/8R
hOdgQQvQ9xq4IApFtb0BFqkKA6grtNdkvCUrD2RiVpQcQ8yhSME//POBE3rLNRaZ
U2dfVJtLko3nULh4M1G2NGkBXcrFdPGE7ai6kB9XkB7X7JwwfZYbFu2j/BhvkgiZ
CLGGbMCxkeDy/963fBOxEPkcxKFcTb978yeEkolIm9CfJnLru5P1wtklAjXJekRW
eIU6gSz+5G7Azo3jQ1YLuPKUgyxH4zmhJysDwvNkEz4AqwwfP4VMcAlXco84ecv+
D9iq/iEokqNYWvMip4fZK5+sgaK82Qm2eGeMN9K4JocudoHGvUBWoIbTaGfbYK/B
+sywHTz7l+sbZ8g1caL3Iyb4BjT1wzB6eUtxEIsivv8pegYZ8DsTkvxqRe6H7F4O
BNKBMBcLUYWxKG4d9q5EaikthMkkw1QWCNrC6/q7zBjcEoJowznJpTPV8vb4Qdx8
kgXYTrKMimpVnju5Ofo62nfFw5m/1HcNC6/JNg4+GMeojJ56TBnDrNrD0vC3W1Rz
mR8KkdyPNq3/FTCyylAs
=b/q3
-----END PGP SIGNATURE-----



More information about the varnish-dev mailing list