Server (IO Thread) =================== Functions and types used to start up the libyimmo core server for WSGI. --------------------------------- Setup --------------------------------- .. c:function:: ymo_server_t* ymo_wsgi_server_init( struct ev_loop* loop, in_port_t http_port, ymo_wsgi_proc_t* proc) Create a new yimmo HTTP server using :c:func:`ymo_http_simple_init`, storing the current :c:type:`ymo_wsgi_proc_t` as the server's ``data`` attribute. .. c:function:: ymo_status_t ymo_wsgi_server_start(struct ev_loop* loop) (At the moment, this is a no-op). --------------------------------- Yimmo Callbacks --------------------------------- .. c:function:: ymo_status_t ymo_wsgi_server_header_cb( ymo_http_session_t* http_session, ymo_http_request_t* request, ymo_http_response_t* response, void* user_data) HTTP header callback, invoked by ``libyimmo_http``. See also: :c:type:`ymo_http_header_cb_t` .. c:function:: ymo_status_t ymo_wsgi_server_request_cb( ymo_http_session_t* http_session, ymo_http_request_t* request, ymo_http_response_t* response, void* user_data) HTTP handler callback, invoked by ``libyimmo_http``. See also: :c:type:`ymo_http_cb_t` --------------------------------- EV Watcher Callbacks --------------------------------- .. c:function:: void ymo_wsgi_server_prepare(struct ev_loop* loop, ev_prepare* w, int revents) We use an `ev_prepare_watcher`_ to check the worker thread output queue for response data before entering the ev loop to wait on events. .. c:function:: void ymo_wsgi_server_check(struct ev_loop* loop, ev_check* w, int revents) We use an `ev_check_watcher`_ to check the output queue for response data when the event loop wakes back up after waiting on events. .. c:function:: void ymo_wsgi_server_async(struct ev_loop* loop, ev_async* w, int revents) This is the callback function for the server's `ev_async_watcher`_, which is used by the *worker thread* (using `ev_async_send`_) to notify the IO thread that some response data is ready for processing.