Class CPythonAsyncProjector

java.lang.Object
nz.org.riskscape.cpython.CPythonAsyncProjector
All Implemented Interfaces:
AutoCloseable, nz.org.riskscape.engine.pipeline.Realized, nz.org.riskscape.engine.projection.AsyncProjector

public class CPythonAsyncProjector extends Object implements nz.org.riskscape.engine.projection.AsyncProjector

Supports sending and receiving tuples from a python process via a buffer, rather than the 'immediate mode' that normal CPython functions use.

This requires that the function be called in its own pipeline step, but allows more flexibility in how the tuples are processed (for instance, we can compile the entire dataset in to a dataframe before emitting rows)

  • Constructor Summary

    Constructors
    Constructor
    Description
    CPythonAsyncProjector(Object errorContext, nz.org.riskscape.engine.types.Struct inputType, nz.org.riskscape.engine.types.Struct producedType, nz.org.riskscape.engine.resource.Resource script, CPythonSpawner processSpawner)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    nz.org.riskscape.engine.pipeline.TupleInput
     
    nz.org.riskscape.engine.pipeline.SinkConstructor
     
    nz.org.riskscape.engine.types.Struct
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.pipeline.Realized

    close
  • Constructor Details

    • CPythonAsyncProjector

      public CPythonAsyncProjector(Object errorContext, nz.org.riskscape.engine.types.Struct inputType, nz.org.riskscape.engine.types.Struct producedType, nz.org.riskscape.engine.resource.Resource script, CPythonSpawner processSpawner)
  • Method Details

    • getProducedType

      public nz.org.riskscape.engine.types.Struct getProducedType()
      Specified by:
      getProducedType in interface nz.org.riskscape.engine.pipeline.Realized
    • getInput

      public nz.org.riskscape.engine.pipeline.TupleInput getInput()
      Specified by:
      getInput in interface nz.org.riskscape.engine.projection.AsyncProjector
    • getOutput

      public nz.org.riskscape.engine.pipeline.SinkConstructor getOutput()
      Specified by:
      getOutput in interface nz.org.riskscape.engine.projection.AsyncProjector