Module rast_worker

rast_worker — one tile-processing loop.

Description

rast_worker — one tile-processing loop.

A worker pulls a tile from the coordinator, reads it, runs the kernel, writes the result, and repeats until the coordinator reports done. Because tiles are refc-binaries, handing them between processes is by-reference and cheap.

The pipeline is injected as three funs so the same loop drives an in-memory source (tests, benches) or the GDAL bridge (production) unchanged:

read :: fun((Tile) -> {ok, binary()} | {error, term()}) kernel :: fun((binary()) -> {ok, binary()} | {error, term()}) write :: fun((Tile, binary()) -> ok | {error, term()})

Data Types

funs()

funs() = #{read := fun((term()) -> {ok, binary()} | {error, term()}), kernel := fun((binary()) -> {ok, binary()} | {error, term()}), write := fun((term(), binary()) -> ok | {error, term()})}

Function Index

start_link/2Spawn a linked worker that drains the coordinator, then exits normal (or with {worker_error, Reason} on the first failing tile).

Function Details

start_link/2

start_link(Coordinator::pid(), Funs::funs()) -> {ok, pid()}

Spawn a linked worker that drains the coordinator, then exits normal (or with {worker_error, Reason} on the first failing tile).


Generated by EDoc