Asynchronous Combo Generator

class pypdevs.realtime.asynchronousComboGenerator.AsynchronousComboGenerator(filename, backend)[source]

The asynchronous combo generator: it generates events from file input The name no longer represents what it actually is, as previously it also generated input from stdin (denoting the ‘combo’). It does NOT use the default interrupt() calls for the threading backend, as this would require the generator to run on a different thread. The generator should be called at every iteration and its getNextTime() value should be taken into account by every wait() call.

__init__(filename, backend)[source]

Constructor.

Parameters
  • filename – the name of the input file to use for file input. None for no file input.

  • backend – subsystem to use for threading

Note

filename parameter should not be a file handle

checkInterrupt(current_time)[source]

Checks for whether an interrupt should happen at this time; if so, it also reschedules the next one. This method must be called before the internal interrupt is fetched, as otherwise it will not be taken into account.

Parameters

current_time – the current simulation time to check for interrupts

getNextTime()[source]

Return the time of the next event from this generator