Skip to content

Allow setting an AttrR/AttrRW without running the callbacks added downstream #133

@evvaaaa

Description

@evvaaaa

In pandablocks FastCS I had a bunch of AttrRW that needed to be the same value. To do this I added a callback (some already have their own handlers), but to avoid retriggering the callback recursively I had to add logic for checking that the value isn't already set:

https://github.com/PandABlocks/fastcs-PandABlocks/blob/15ac390efcc223cdad5d8d627f569ca841d58748/src/fastcs_pandablocks/panda/handlers.py#L101-L126

Suggestion

We change _update_callbacks to _transport_update_callbacks and _user_update_callbacks. The transport update callbacks will always be ran, however AttrR.set will have a kwarg for run_update_callbacks=True which can toggle whether _user_update_callbacks will be ran.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs designRequires more thought about how to do this and more detail adding to the description

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions