Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Hosts: More options for in-host callbacks #3357

Merged
merged 8 commits into from
Jun 20, 2022

Conversation

iLLiCiTiT
Copy link
Member

Brief description

Modules are acknowledged on host installation that host was installed so they can register their specific callbacks. Workfiles tool also trigger events on workfile open. Moved start timer callback on task change to timers manager.

Description

Modules have method on_host_install which is called when install_host is called, these modules are kept in memory (they're not refreshed for rest of process) that is because modules would be garbage collected and their callbacks would not work. Workfiles tool is triggering workfile.open.before and workfile.open.after. All events triggered from workfiles tool also contain context information (host name, project name, asset name and task name) so it's not just blind information. Task changed topic has human readable keys. Logic related to start timer on task change was moved to timers manager module.

Additional information

Reason of this feature is to be able register event callbacks which are module specific and to be able catch workfiles opening when workfiles tool is used.

Testing notes:

Change related to timers manager:

  1. Make that you have some module with time management enabled (e.g. ftrack module)
  2. Run application on a task (timer should start for the task)
  3. Change context to different task using workfiles tool inside host
  4. Check if timer for the new task was started

New feature adding ability to catch host installation:

  1. Implement in any module method on_host_install where you can do some logic which you want.

@ynbot
Copy link
Contributor

ynbot commented Jun 16, 2022

Task linked: OP-3420 Trigger callback on workfile open

@iLLiCiTiT iLLiCiTiT self-assigned this Jun 16, 2022
@iLLiCiTiT iLLiCiTiT added the type: enhancement Enhancements to existing functionality label Jun 16, 2022
@iLLiCiTiT iLLiCiTiT merged commit c782c61 into develop Jun 20, 2022
@iLLiCiTiT iLLiCiTiT deleted the feature/OP-3420_Trigger-callback-on-workfile-open branch June 20, 2022 11:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants