Jump to content

TOPs, keep polling


Johan

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

Link to comment
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 3
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...