For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
ProduceContext
struct ProduceContext[pipeline_origin: MutOrigin, num_stages: Int]
Context manager for producing one pipeline stage.
- enter: Waits for consumer to be ready, returns ref to stage
- exit: Releases the stage (advances producer)
Note: The actual production signal (mma_arrive) is kernel-specific and must be called by the user before exiting the context.
Fieldsβ
- βpipeline (
Pointer[ProducerConsumerPipeline[num_stages], pipeline_origin]):
Implemented traitsβ
AnyType,
ImplicitlyDestructible
Methodsβ
__init__β
__init__(out self, pipeline: Pointer[ProducerConsumerPipeline[num_stages], pipeline_origin])
__enter__β
__enter__(mut self) -> ref[self._stage._value] ProducerStage[pipeline_origin, num_stages]
Wait for consumer and return reference to stage.
Returns:
ref[self._stage._value] ProducerStage[pipeline_origin, num_stages]
__exit__β
__exit__(mut self)
Release the stage (advances producer).
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!