Skip to content

Generator[A: Any #send]

[Source]

A Generator creates data on demand which will be sent to various Worker instances where the data will be processed.

interface ref Generator[A: Any #send]

Public Functions

init

[Source]

Called before the first time the generator is called. Allows the generator to distribute work based on the number of workers available.

fun ref init(
  workers: USize val)
: None val

Parameters

Returns


apply

[Source]

Called each time a worker needs data.

If no additional data is available, error should be returned.

fun ref apply()
: A^ ?

Returns

  • A^ ?