Jump to content
Sign in to follow this  
Johan

TOPs, keep polling

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

  • Like 2

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×