2017-05-26 12:17:45 +00:00
|
|
|
#ifndef OD_ROUTER_H
|
|
|
|
#define OD_ROUTER_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* odissey.
|
|
|
|
*
|
|
|
|
* PostgreSQL connection pooler and request router.
|
|
|
|
*/
|
|
|
|
|
|
|
|
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,
|
|
|
|
OD_RERROR_LIMIT
|
|
|
|
} od_routerstatus_t;
|
|
|
|
|
2017-05-26 12:17:45 +00:00
|
|
|
struct od_router
|
|
|
|
{
|
2017-05-26 13:44:42 +00:00
|
|
|
int64_t machine;
|
|
|
|
od_routepool_t route_pool;
|
|
|
|
machine_queue_t queue;
|
|
|
|
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-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
|
|
|
|
|
|
|
void
|
2017-05-29 15:07:22 +00:00
|
|
|
od_router_detach(od_server_t*);
|
2017-05-27 13:14:39 +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 */
|