Skip to content

graflo.architecture.pipeline.runtime.executor

Execution surface for actor extraction and assembly orchestration.

Attributes

Classes

ActorExecutor

Owns runtime extraction and assembly orchestration for an ActorWrapper.

Source code in graflo/architecture/pipeline/runtime/executor.py
class ActorExecutor:
    """Owns runtime extraction and assembly orchestration for an ActorWrapper."""

    def __init__(self, root: ActorWrapper):
        self.root = root

    def extract(self, doc: dict) -> ExtractionContext:
        extraction_ctx = ExtractionContext()
        return self.root(extraction_ctx, doc=doc)

    def assemble(
        self, extraction_ctx: ExtractionContext
    ) -> defaultdict[GraphEntity, list]:
        """The assembled entities; :meth:`assemble_result` adds the attached rows."""
        return self.assemble_result(extraction_ctx).entities

    def assemble_result(self, extraction_ctx: ExtractionContext) -> GraphAssemblyResult:
        assembly_ctx = AssemblyContext.from_extraction(extraction_ctx)
        entities = self.root.assemble(assembly_ctx)
        return GraphAssemblyResult(
            entities=entities, attached=dict(assembly_ctx.acc_attached)
        )

Attributes

root = root instance-attribute

Methods:

__init__(root)
Source code in graflo/architecture/pipeline/runtime/executor.py
def __init__(self, root: ActorWrapper):
    self.root = root
assemble(extraction_ctx)

The assembled entities; :meth:assemble_result adds the attached rows.

Source code in graflo/architecture/pipeline/runtime/executor.py
def assemble(
    self, extraction_ctx: ExtractionContext
) -> defaultdict[GraphEntity, list]:
    """The assembled entities; :meth:`assemble_result` adds the attached rows."""
    return self.assemble_result(extraction_ctx).entities
assemble_result(extraction_ctx)
Source code in graflo/architecture/pipeline/runtime/executor.py
def assemble_result(self, extraction_ctx: ExtractionContext) -> GraphAssemblyResult:
    assembly_ctx = AssemblyContext.from_extraction(extraction_ctx)
    entities = self.root.assemble(assembly_ctx)
    return GraphAssemblyResult(
        entities=entities, attached=dict(assembly_ctx.acc_attached)
    )
extract(doc)
Source code in graflo/architecture/pipeline/runtime/executor.py
def extract(self, doc: dict) -> ExtractionContext:
    extraction_ctx = ExtractionContext()
    return self.root(extraction_ctx, doc=doc)