#ifndef LCBIO_MANAGER_H
#define LCBIO_MANAGER_H
#include "connect.h"
#include "settings.h"
#include "contrib/genhash/genhash.h"
#include "list.h"
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
struct lcbio_MGRREQ;
typedef struct lcbio_MGR {
genhash_t* ht;
lcb_settings *settings;
lcbio_pTABLE io;
uint32_t tmoidle;
unsigned maxtotal;
unsigned maxidle;
unsigned refcount;
} lcbio_MGR;
LCB_INTERNAL_API
lcbio_MGR*
lcbio_mgr_create(lcb_settings *settings, lcbio_pTABLE io);
LCB_INTERNAL_API
void
lcbio_mgr_destroy(lcbio_MGR *);
LCB_INTERNAL_API
struct lcbio_MGRREQ *
lcbio_mgr_get(lcbio_MGR *mgr, lcb_host_t *dest, uint32_t timeout,
lcbio_CONNDONE_cb handler, void *arg);
LCB_INTERNAL_API
void
lcbio_mgr_cancel(struct lcbio_MGRREQ *req);
LCB_INTERNAL_API
void lcbio_mgr_put(lcbio_SOCKET *sock);
LCB_INTERNAL_API
void lcbio_mgr_discard(lcbio_SOCKET *sock);
LCB_INTERNAL_API
void lcbio_mgr_detach(lcbio_SOCKET *sock);
LCB_INTERNAL_API
void lcbio_mgr_dump(lcbio_MGR *mgr, FILE *out);
#ifdef __cplusplus
}
#endif
#endif