52 }; |
53 }; |
53 |
54 |
54 /* |
55 /* |
55 * BasicSessionHandler |
56 * BasicSessionHandler |
56 * |
57 * |
57 * The BasicSessionHandler enqueues the connections to a threadpool. IO and |
58 * The BasicSessionHandler enqueues the connections to a threadpool. IO is |
58 * request processing is handled by one thread. |
59 * handled by the threadpool. |
59 */ |
60 */ |
60 typedef struct _basic_session_handler { |
61 typedef struct _basic_session_handler { |
61 SessionHandler sh; |
62 SessionHandler sh; |
62 threadpool_t *threadpool; |
63 threadpool_t *threadpool; |
63 |
64 |
64 } BasicSessionHandler; |
65 } BasicSessionHandler; |
|
66 |
|
67 /* |
|
68 * EventSessionHandler |
|
69 * |
|
70 * The EventSessionHandler uses a event handler to handle request inputs. |
|
71 */ |
|
72 typedef struct _event_session_handler { |
|
73 SessionHandler sh; |
|
74 event_handler_t *eventhandler; |
|
75 } EventSessionHandler; |
|
76 |
|
77 /* |
|
78 * EventHttpIO |
|
79 * |
|
80 * defined in sesionhandler.c |
|
81 */ |
65 |
82 |
66 |
83 |
67 SessionHandler* create_basic_session_handler(); |
84 SessionHandler* create_basic_session_handler(); |
68 |
85 |
69 void basic_enq_conn(SessionHandler *handler, Connection *conn); |
86 void basic_enq_conn(SessionHandler *handler, Connection *conn); |
70 |
87 |
71 void* basic_run_session(void *data); |
88 void* basic_run_session(void *data); |
72 |
89 |
73 |
90 |
|
91 SessionHandler* create_event_session_handler(); |
|
92 |
|
93 void evt_enq_conn(SessionHandler *handler, Connection *conn); |
|
94 |
|
95 void evt_request_input(event_handler_t *h, event_t *event); |
|
96 |
74 |
97 |
75 #ifdef __cplusplus |
98 #ifdef __cplusplus |
76 } |
99 } |
77 #endif |
100 #endif |
78 |
101 |