Registering new global placeholders

Continuing the placeholder registration question in 21468.

Is it possible to register new “global placeholders” (placeholders that are always available, like the {env.*}, {system.*}, {time.*} placeholders)? Or is it possible to extend the existing global ones, like {system.*}? If yes, example code snippets would be appreciated!

No, it’s not.

Then is it possible to register placeholders in active health checks?

What’s your goal exactly?

Quite simple, in fact. Generating a rolling ID available within a site, which could be used in request handling and active health checking.

What do you mean by “rolling ID”? Do you mean an increasing counter? Does it have to be a counter?

You can use {http.request.uuid} in regular request handlers (but not active health checks because it’s outside of regular requests).

Why do you need this?

Not a counter. The rolling ID has to be persistent, and updated at a certain interval. This will rule out any single-use ID.

As of why it’s needed, let’s say “reproducible sticky-hash load balancing”.

I’m not sure I understand. You’re explaining in very vague terms so we can’t have much of a useful conversation.

Anyway, like I wrote here:

Before we can commit to looking into making global placeholders pluggable, we need to figure out how we want {file.*} to be implemented because it’ll determine how that API will look.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.