webql/engine

Copy Markdown

Types

Engine

pub type Engine(task, memory, error) {
  Engine(
    handle_run: fn(fn() -> Result(task, error)) -> task,
    handle_start_plan: fn(
      fn() -> Result(
        #(memory, List(fn(memory) -> task)),
        diagnostic.Diagnostic,
      ),
    ) -> task,
    handle_finish_plan: fn(
      task,
      fn(memory) -> Result(dynamic.Dynamic, diagnostic.Diagnostic),
    ) -> task,
    handle_start_batch: fn(
      fn() -> Result(List(task), diagnostic.Diagnostic),
    ) -> task,
    handle_finish_batch: fn(
      memory,
      task,
      fn(memory, memory) -> memory,
    ) -> task,
    handle_start_step: fn(
      fn() -> Result(task, diagnostic.Diagnostic),
    ) -> task,
    handle_finish_step: fn(
      task,
      fn(Result(dynamic.Dynamic, dynamic.Dynamic)) -> Result(
        memory,
        diagnostic.Diagnostic,
      ),
    ) -> task,
  )
}
Engine(
  handle_run: fn(fn() -> Result(task, error)) -> task,
  handle_start_plan: fn(
    fn() -> Result(
      #(memory, List(fn(memory) -> task)),
      diagnostic.Diagnostic,
    ),
  ) -> task,
  handle_finish_plan: fn(
    task,
    fn(memory) -> Result(dynamic.Dynamic, diagnostic.Diagnostic),
  ) -> task,
  handle_start_batch: fn(
    fn() -> Result(List(task), diagnostic.Diagnostic),
  ) -> task,
  handle_finish_batch: fn(
    memory,
    task,
    fn(memory, memory) -> memory,
  ) -> task,
  handle_start_step: fn(
    fn() -> Result(task, diagnostic.Diagnostic),
  ) -> task,
  handle_finish_step: fn(
    task,
    fn(Result(dynamic.Dynamic, dynamic.Dynamic)) -> Result(
      memory,
      diagnostic.Diagnostic,
    ),
  ) -> task,
)

HandleFinishBatch

pub type HandleFinishBatch(task, memory) =
  fn(memory, task, fn(memory, memory) -> memory) -> task

HandleFinishPlan

pub type HandleFinishPlan(task, memory) =
  fn(
    task,
    fn(memory) -> Result(dynamic.Dynamic, diagnostic.Diagnostic),
  ) -> task

HandleFinishStep

pub type HandleFinishStep(task, memory) =
  fn(
    task,
    fn(Result(dynamic.Dynamic, dynamic.Dynamic)) -> Result(
      memory,
      diagnostic.Diagnostic,
    ),
  ) -> task

HandleRun

pub type HandleRun(task, error) =
  fn(fn() -> Result(task, error)) -> task

HandleStartBatch

pub type HandleStartBatch(task) =
  fn(fn() -> Result(List(task), diagnostic.Diagnostic)) -> task

HandleStartPlan

pub type HandleStartPlan(task, memory) =
  fn(
    fn() -> Result(
      #(memory, List(fn(memory) -> task)),
      diagnostic.Diagnostic,
    ),
  ) -> task

HandleStartStep

pub type HandleStartStep(task) =
  fn(fn() -> Result(task, diagnostic.Diagnostic)) -> task