A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
builtins.h File Reference

The actions every A11 peer answers, whatever it was built to do. More...

#include <string>
#include <string_view>
#include <vector>
#include <absl/base/nullability.h>
#include "a11/actions/action.h"
#include "a11/actions/schema.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  a11::actions::BuiltinAction
 A schema and handler pair the registry resolves without holding. More...
 

Namespaces

namespace  a11
 
namespace  a11::actions
 

Functions

bool a11::actions::IsBuiltinAction (std::string_view name)
 Whether name is a builtin every registry answers for.
 
const BuiltinAction *absl_nullable a11::actions::GetBuiltinAction (std::string_view name)
 The builtin named name, or null.
 
const std::vector< std::string > & a11::actions::BuiltinActionNames ()
 Every builtin's name, sorted.
 

Variables

constexpr std::string_view a11::actions::kListActionsName = "__list_actions__"
 Lists the actions a peer serves, with their schemas.
 
constexpr std::string_view a11::actions::kGetSchemaName = "__get_schema__"
 Returns one action's schema, or NotFound.
 
constexpr std::string_view a11::actions::kPingName = "__ping"
 Echoes a value, so a caller can tell A11 from anything holding a port.
 

Detailed Description

The actions every A11 peer answers, whatever it was built to do.

Why these are not registrations. A peer that cannot be asked what it serves has to be told, and telling is what four hand-copied handshakes were for. So discovery cannot be something an application remembers to install: it has to hold for a registry nobody configured, for a registry a service copied per connection, and for a registry an application has since called Unregister all over. That rules out being an entry in

a11::actions::ActionRegistry – <tt>Register</tt> replaces and <tt>Unregister</tt> removes

and it rules out a service-level install, because every client builds its own bare registry and would have nothing.

What holds instead is a table here, consulted by the registry on a miss. So ActionRegistry() is still empty of anything an application put there, while every lookup, every listing, and every Flow call resolves these three.

The handlers reach their registry through a11::actions::Action::GetRegistry rather than capturing one, which is what keeps this a function-local static and not a cycle from a registry to a handler that owns it.