#[preload]Expand description
The Java @PreLoad(route, instances, envInstances) analog: registers a
composable function at startup.
Parameters:
route = "my.function.route"(required). A comma-separated list registers the same function under several route names (aliases) with the same instance count and visibility — the Java@PreLoad(route = "hello.world, hello.declarative")behavior. Each name is whitespace-trimmed; an empty segment is a compile error.instances = N(default 1)env_instances = "config.key"— read the instance count from application configuration at startup, falling back toinstances(JavaenvInstances)is_private = false— a PUBLIC function, callable from another application instance through Event over HTTP. Java@PreLoadparity: preloaded functions are private by default (in-instance only); opt into public visibility explicitly (JavaisPrivate = false)typed— the struct implementsTypedFunction<I, O>; it is wrapped in aTypedAdapter(without this flag the struct must implementComposableFunction)
Consumed marker attributes (place them below #[preload]):
#[zero_tracing]— the Java@ZeroTracing: this route’s executions are excluded from distributed-trace recording.#[event_interceptor]— the Java@EventInterceptor: the function receives the raw envelope (reply_to/cidintact) and replies manually viapo.send; the worker sends no auto-reply on success (also available as theinterceptorflag parameter).#[optional_service("condition")]— see [optional_service]: a first-class attribute that also works stacked above this one.
The struct must be a unit struct or implement Default.