Reputation: 21
how to schedule a container to run whenever new data gets inserted into database? Like i want my container to run whenever new write request came into my PostgreSQL database.
In cron i can schedule container to run on specific time but not on data come basis.
Upvotes: 0
Views: 67
Reputation: 2744
You can use producer and consumer mechanism, often used with the RabbitMQ service. within your application there should be an event (example: Propel postInsert() or postUpdate() methods) and when that event happens, put an item to the queue. then, make the consumer go through the items and run a container run command.
Upvotes: 1