odyssey/src/od_router.h

44 lines
670 B
C
Raw Normal View History

#ifndef OD_ROUTER_H
#define OD_ROUTER_H
/*
* odissey.
*
* PostgreSQL connection pooler and request router.
*/
typedef struct od_router od_router_t;
typedef enum
{
OD_ROK,
OD_RERROR,
OD_RERROR_NOT_FOUND,
OD_RERROR_LIMIT
} od_routerstatus_t;
struct od_router
{
int64_t machine;
od_routepool_t route_pool;
machine_queue_t queue;
od_system_t *system;
};
int od_router_init(od_router_t*, od_system_t*);
int od_router_start(od_router_t*);
od_routerstatus_t
od_route(od_client_t*);
od_routerstatus_t
od_router_attach(od_client_t*);
void
od_router_detach(od_server_t*);
2017-05-30 11:34:08 +00:00
od_routerstatus_t
od_router_cancel(od_client_t*);
#endif /* OD_ROUTER_H */