Threading Backend

class pypdevs.realtime.threadingBackend.ThreadingBackend(subsystem, args)[source]

Wrapper around the actual threading backend. It will also handle interrupts and the passing of them to the calling thread.

__init__(subsystem, args)[source]

Constructor

Parameters
  • subsystem – string specifying the subsystem to use: python, tkinter or loop

  • args – all additional arguments that should be passed to the subsystem’s constructor (must be a list)

getInterrupt()[source]

Return the value of the interrupt and clear it internally.

Returns

the interrupt

interrupt(value)[source]

Interrupt a running wait call, overwriting any previous interrupts.

Parameters

value – the value that interrupts

setInterrupt(value)[source]

Sets the value of the interrupt. This should not be used manually and is only required to prevent the asynchronous combo generator from making interrrupt() calls.

Parameters

value – value with which the interrupt variable should be set

step()[source]

Perform a step in the backend; only supported for the game loop backend.

wait(time, func)[source]

A non-blocking call, which will call the func parameter after time seconds. It will use the provided backend to do this.

Parameters
  • time – time to wait in seconds, a float is possible

  • func – the function to call after the time has passed