-
Notifications
You must be signed in to change notification settings - Fork 128
Description
Hi. Right now I'm working on an entirely stored procedure based coordination framework called pgtask. Think of it as a centralized cron for controlling database task execution in complex environments; I believe there to be a technical niche there. Anyways, I'm interested in being able to tap web services in addition to target remote database calls. For this to work in my architecture, I'd need to have some kind of asynchronous API; something along the lines of dblink_send for asynchronous querying (which I use to send queries since the coordinator is single threaded).
An ideal API would be able to do something like:
*) http_send (name, ...) send a named http request
*) http_request_complete(name, ) is the http request resolved?
*) http_get_request (name, timeout, ...) get a response, blocking until timeout if not done
*) http_wait_for_request(timeout) wait for the first available request to complete or until timeout. (epoll like interface to prevent polling/looping in sql) -- dblink really needs this
*) http_cancel_request (name, ...) cancel an outstanding request
*) http_list_requests() get a list of outstanding http requests
Food for thought. I don't know if this api (esp wait_for_request call) is technically feasible, but it would make this a much more usable extension since database queries are essentially can be considered single threaded environment. Anyways, thanks for your work!