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()})
funs() = #{read := fun((term()) -> {ok, binary()} | {error, term()}), kernel := fun((binary()) -> {ok, binary()} | {error, term()}), write := fun((term(), binary()) -> ok | {error, term()})}
| start_link/2 | Spawn a linked worker that drains the coordinator, then exits normal
(or with {worker_error, Reason} on the first failing tile). |
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