Struct Endpoint
pub struct Endpoint {
pub url: String,
pub types: Vec<String>,
pub secret: Option<Secret>,
pub concurrency: u32,
pub budget: Duration,
pub max_shards: u32,
pub grace: Duration,
pub tls: Option<Tls>,
}Expand description
An HTTP endpoint the server invokes workers at.
Fields§
§url: Stringhttp:// or https://.
types: Vec<String>Workflow types this endpoint has code for; empty: every type.
secret: Option<Secret>Signs each request (sign). None sends no signature: only for
an endpoint that checks the server’s client certificate instead.
concurrency: u32Invocations in flight at once, at most.
budget: DurationHow long one invocation may take, at most the platform’s limit.
max_shards: u32Shards per invocation, at most; 0: no limit.
grace: DurationHow much longer than the budget the server waits for an answer before it fences the invocation. Default 30 s.
tls: Option<Tls>For https://: the CA that signs the endpoint’s certificate (the
system bundle if None), and the server’s client certificate for
mutual TLS.
Implementations§
§impl Endpoint
impl Endpoint
pub fn new(url: impl Into<String>, secret: Option<Secret>) -> Self
pub fn new(url: impl Into<String>, secret: Option<Secret>) -> Self
An endpoint with the defaults: every type, 16 invocations at once, a 60 s budget, no limit on shards per invocation.
pub fn types(self, types: &[&str]) -> Self
pub fn concurrency(self, n: u32) -> Self
pub fn budget(self, d: Duration) -> Self
pub fn max_shards(self, n: u32) -> Self
pub fn grace(self, d: Duration) -> Self
pub fn tls(self, tls: Tls) -> Self
pub fn from_json(v: &Value) -> Result<Self>
pub fn from_json(v: &Value) -> Result<Self>
An endpoint from its configuration: {"url": ..., "types": [...], "secretFile": PATH, "concurrency": N, "budgetMs": N, "shards": N, "graceMs": N, "ca": PATH, "cert": PATH, "key": PATH}; only url is
required. Unknown keys are refused, so a misspelt one never silently
drops a setting.