Johan Posted July 26, 2020 Share Posted July 26, 2020 I'm trying to figure out if a TOP's/PDG network can be made to keep alive while waiting for data from a database. Basically I want something like a while loop in python that keeps the TOP network waiting for new items to appear in the data base and then start processing once a new work_item is available. Is TOPs/PDG even meant for such a thing? Thanks! -Johan Quote Link to comment Share on other sites More sharing options...
Johan Posted July 27, 2020 Author Share Posted July 27, 2020 Ok, so I have found a solution, which I think could be improved upon. This setup keeps a heartbeat runnig for 30 seconds and each second you can generate new work_items. You can obviously change number of heartbeats and wait time. So this allows you to fetch live data form a database or folder for example and act accordingly. There's no logic for tracking what was processed, you need to build that yourself. But it's at least a way to keep houdini polling. Now in the file, I have also 2 python generators which I think would be the proper solution, but can't get to work. I'd love to know if there's anything better of more robust perhaps. Hope it helps someone and if you have feedback please let me know! PDG_while_loop_tests.hiplc 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.