fastcs.methods.scan#

fastcs.methods.scan.UnboundScanCallback#

A Scan callback that is unbound and must be called with a Controller instance

alias of Callable[[Controller_T], Coroutine[None, None, None]]

fastcs.methods.scan.ScanCallback#

A Scan callback that is bound and can be called without self

alias of Callable[[], Coroutine[None, None, None]]

class fastcs.methods.scan.Scan(fn: Callable[[], Coroutine[None, None, None]], period: float)[source]#

A Controller Method that will be called periodically in the background.

This class contains a function that is bound to a specific Controller instance and is callable outside of the class context, without an explicit self parameter. Calling an instance of this class will call the bound Controller method.

class fastcs.methods.scan.UnboundScan(fn: Callable[[Controller_T], Coroutine[None, None, None]], period: float)[source]#

A wrapper of an unbound Controller method to be bound into a Scan.

This generic class stores an unbound Controller method - effectively a function that takes an instance of a specific Controller type (Controller_T). Instances of this class can be added at Controller definition, either manually or with use of the scan wrapper, to register the method to be included in the API of the Controller. When the Controller is instantiated, these instances will be bound to the instance, creating a Scan instance.

fastcs.methods.scan.scan(period: float) Callable[[Callable[[Controller_T], Coroutine[None, None, None]]], Callable[[Controller_T], Coroutine[None, None, None]]][source]#

Decorator to register a Controller method as a Scan

The Scan method will be called periodically in the background.