YuChen Posted November 18, 2021 Report Share Posted November 18, 2021 Hi all, I wonder if there's any sesssion attribute I can use for checking connection to server have been made. "wait" function trick works, but I think there should be an elegant solution session = ftrack_api.Session(auto_connect_event_hub=True) session.event_hub.subscribe('topic=custom.test_event1', my_callback) custom_event = ftrack+api.event.base.Event(topic='custom.test_event1', data={}) session.event_hub.wait(duration=5) # Given enough time to connect to server session.event_hub.publish(custom_event) session.event_hub.wait(duration=5) # Given enough time to recieve the callback result Any suggestion ? Link to comment Share on other sites More sharing options...
PeterH Posted November 26, 2021 Report Share Posted November 26, 2021 Seems to work if you just manually call "session.event_hub.connect()" instead of "auto_connect_event_hub=True" Link to comment Share on other sites More sharing options...
YuChen Posted December 1, 2021 Author Report Share Posted December 1, 2021 Awesome ! Since "session.event_hub.connect" works so well, why we need "ftrack_api.Session(auto_connect_event_hub=True)" ? I mean, in what situation should I connect manually and others use auto connect ? Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted December 2, 2021 Report Share Posted December 2, 2021 HI @YuChen and @PeterH would you mind trying updating the ftrack-python-api to the latest release version (2.3.0) This version released early this month (9Th Nov) provide a fix for your issue. Hope it helps. L. Link to comment Share on other sites More sharing options...
YuChen Posted December 14, 2021 Author Report Share Posted December 14, 2021 Hi @Lorenzo Angeli Sorry not getting back to you sooner. I'm not allow to install Python 3 in company's machine so can not test with that issue. Please let me know if you need my testing file. Thanks. Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted December 16, 2021 Report Share Posted December 16, 2021 Hi @YuChenno worries, the ftrack-python-api 2.3.0 also run on python2.7.9+ . If you do have a file , please send it to support@ftrack.com so we can have a closer look. Cheers. L. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now