corvix.pipeline.provider¶
Unified provider interfaces and shared context for the pipeline.
Classes¶
Per-cycle request budget and URL cache shared across all pipeline providers. |
|
Provider that completes missing canonical fields on a |
|
Provider that attaches optional contextual data to a |
Module Contents¶
- class corvix.pipeline.provider.PipelineContext[source][source]¶
Bases:
corvix.pipeline.base.RequestContextPer-cycle request budget and URL cache shared across all pipeline providers.
A single
PipelineContextis created perPipelineEngine.run()call and passed to every provider, so that URL responses cached by a field-completion provider are visible to subsequent context providers in the same cycle.- get_json(client: corvix.pipeline.base.JsonFetchClient, url: str, timeout_seconds: float) corvix.types.JsonValue[source][source]¶
Fetch and cache a JSON payload; raises if the request budget is exhausted.
- class corvix.pipeline.provider.FieldProvider[source][source]¶
Bases:
ProtocolProvider that completes missing canonical fields on a
Notification.Field providers mutate the notification in-place by returning a (possibly replaced)
Notificationwith missing required fields filled in (e.g.subject_url,web_url).- hydrate(_notification: corvix.domain.Notification, _client: corvix.pipeline.base.JsonFetchClient, _ctx: PipelineContext, /) corvix.domain.Notification[source][source]¶
Return a notification with any missing required fields filled in.
- class corvix.pipeline.provider.ContextProvider[source][source]¶
Bases:
ProtocolProvider that attaches optional contextual data to a
Notification.Context providers return a mapping that is merged under the provider’s
namenamespace incontext.- enrich(_notification: corvix.domain.Notification, _client: corvix.pipeline.base.JsonFetchClient, _ctx: PipelineContext, /) dict[str, object][source][source]¶
Return a mapping of context data to attach under this provider’s namespace.