odyssey/sources/router.h

57 lines
950 B
C
Raw Normal View History

#ifndef OD_ROUTER_H
#define OD_ROUTER_H
/*
2018-03-12 14:03:15 +00:00
* Odyssey.
*
2018-04-04 13:19:58 +00:00
* Scalable PostgreSQL connection pooler.
*/
typedef struct od_router od_router_t;
typedef enum
{
OD_ROK,
OD_RERROR,
OD_RERROR_NOT_FOUND,
2017-06-08 12:36:21 +00:00
OD_RERROR_LIMIT,
OD_RERROR_TIMEDOUT
} od_routerstatus_t;
struct od_router
{
od_routepool_t route_pool;
machine_channel_t *channel;
int clients;
2018-03-13 13:17:27 +00:00
od_global_t *global;
};
2018-03-13 13:17:27 +00:00
void od_router_init(od_router_t*, od_global_t*);
int od_router_start(od_router_t*);
od_routerstatus_t
od_route(od_client_t*);
od_routerstatus_t
od_unroute(od_client_t*);
od_routerstatus_t
od_router_attach(od_client_t*);
od_routerstatus_t
od_router_detach(od_client_t*);
od_routerstatus_t
od_router_detach_and_unroute(od_client_t*);
od_routerstatus_t
od_router_close(od_client_t*);
od_routerstatus_t
od_router_close_and_unroute(od_client_t*);
2017-05-30 11:34:08 +00:00
od_routerstatus_t
2018-02-22 13:43:52 +00:00
od_router_cancel(od_client_t*, od_routercancel_t*);
2017-05-30 11:34:08 +00:00
#endif /* OD_ROUTER_H */