Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly use targets without global registration #363

Closed
buddly27 opened this issue Mar 9, 2020 · 0 comments · Fixed by #364
Closed

Explicitly use targets without global registration #363

buddly27 opened this issue Mar 9, 2020 · 0 comments · Fixed by #364

Comments

@buddly27
Copy link
Contributor

buddly27 commented Mar 9, 2020

The pyblish.util.publish() function (and all helpers for specific CVEI stage) can take a list of targets but pyblish.util._convenience_iter() uses the global registration in the backend, which causes a bunch of issues:

>>> pyblish.plugin.register_target("foo")
>>> print(pyblish.api.registered_targets())
["foo"]
>>> pyblish.util.publish(targets=["foo", "bar"])
>>> print(pyblish.api.registered_targets())
[]
  • It is impossible to run 2 processes simultaneously with different targets
>>> t1 = threading.Thread(target=pyblish.util.publish, kwargs={"targets": ["foo"]})
>>> t2 = threading.Thread(target=pyblish.util.publish, kwargs={"targets": ["bar"]})
>>> t1.start() # Register "foo"
>>> t2.start() # Register "bar" while t1 is still running...

It would be nice to modify the logic so that targets explicitly passed to these functions don't get registered globally. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant