pyrolab.server.Lockable

Contents

pyrolab.server.Lockable#

class Lockable[source]#

Bases: object

The Lockable instrument mixin. Only works with LockableDaemon.

Rejects new connections at the Daemon level when locked. Daemon stores the user who locked the device for reference.

This mixin only makes sense in the context of a Daemon. It is not intended for use with local instruments. Additionally, any service registered with a LockableDaemon will automatically have this mixin added to it.

Examples

class MyCustomService(Service, Lockable):
    def __init__(self, *args, **kwargs):
        pass

Methods

islocked()

Returns the status of the lock.

lock([user])

Locks access to the object's attributes.

unlock()

Releases the lock on the object.