2017-05-26 12:17:45 +00:00
|
|
|
#ifndef OD_ROUTER_H
|
|
|
|
#define OD_ROUTER_H
|
|
|
|
|
|
|
|
/*
|
2017-07-05 12:42:49 +00:00
|
|
|
* Odissey.
|
2017-05-26 12:17:45 +00:00
|
|
|
*
|
2017-07-05 12:42:49 +00:00
|
|
|
* Advanced PostgreSQL connection pooler.
|
2017-05-26 12:17:45 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct od_router od_router_t;
|
|
|
|
|
2017-05-26 13:44:42 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
OD_ROK,
|
|
|
|
OD_RERROR,
|
|
|
|
OD_RERROR_NOT_FOUND,
|
2017-06-08 12:36:21 +00:00
|
|
|
OD_RERROR_LIMIT,
|
|
|
|
OD_RERROR_TIMEDOUT
|
2017-05-26 13:44:42 +00:00
|
|
|
} od_routerstatus_t;
|
|
|
|
|
2017-05-26 12:17:45 +00:00
|
|
|
struct od_router
|
|
|
|
{
|
2017-06-20 15:39:52 +00:00
|
|
|
od_routepool_t route_pool;
|
2017-06-13 11:57:54 +00:00
|
|
|
machine_queue_t *queue;
|
2017-06-20 15:39:52 +00:00
|
|
|
int clients;
|
|
|
|
od_system_t *system;
|
2017-05-26 12:17:45 +00:00
|
|
|
};
|
|
|
|
|
2017-05-26 13:44:42 +00:00
|
|
|
int od_router_init(od_router_t*, od_system_t*);
|
|
|
|
int od_router_start(od_router_t*);
|
|
|
|
|
|
|
|
od_routerstatus_t
|
2017-05-29 15:07:22 +00:00
|
|
|
od_route(od_client_t*);
|
2017-05-26 12:17:45 +00:00
|
|
|
|
2017-06-01 09:28:23 +00:00
|
|
|
od_routerstatus_t
|
|
|
|
od_unroute(od_client_t*);
|
|
|
|
|
2017-05-27 13:14:39 +00:00
|
|
|
od_routerstatus_t
|
2017-05-29 15:07:22 +00:00
|
|
|
od_router_attach(od_client_t*);
|
2017-05-27 13:14:39 +00:00
|
|
|
|
2017-05-31 10:49:12 +00:00
|
|
|
od_routerstatus_t
|
|
|
|
od_router_detach(od_client_t*);
|
|
|
|
|
|
|
|
od_routerstatus_t
|
|
|
|
od_router_detach_and_unroute(od_client_t*);
|
2017-05-27 13:14:39 +00:00
|
|
|
|
2017-05-31 10:49:12 +00:00
|
|
|
od_routerstatus_t
|
|
|
|
od_router_close_and_unroute(od_client_t*);
|
2017-05-30 15:04:59 +00:00
|
|
|
|
2017-05-30 11:34:08 +00:00
|
|
|
od_routerstatus_t
|
|
|
|
od_router_cancel(od_client_t*);
|
|
|
|
|
2017-05-26 12:17:45 +00:00
|
|
|
#endif /* OD_ROUTER_H */
|