diff --git a/examples/filter/src/database/database_api.e b/examples/filter/src/database/database_api.e index 669ef656..d57f3dda 100644 --- a/examples/filter/src/database/database_api.e +++ b/examples/filter/src/database/database_api.e @@ -46,8 +46,6 @@ feature -- Access -- User with id `a_id' or name `a_name'. require a_id > 0 xor a_name /= Void - local - n: like {USER}.name do if a_id > 0 then Result := user_by_id (a_id) diff --git a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e index 372a20a0..e4a23692 100644 --- a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e +++ b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e @@ -24,6 +24,7 @@ feature -- Access feature -- Execution launch + -- Launch execution of CGI application. local req: WGI_REQUEST_FROM_TABLE res: detachable WGI_RESPONSE_STREAM @@ -51,6 +52,7 @@ feature -- Execution end process_rescue (res: detachable WGI_RESPONSE) + -- Handle rescued execution of current request. do if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.trace as l_trace then if res /= Void then diff --git a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e index ed8209e0..88c74ecc 100644 --- a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e +++ b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e @@ -22,6 +22,7 @@ inherit feature {NONE} -- Initialization default_create + -- Create libFCGI connector. do Precursor {WGI_CONNECTOR} create fcgi.make @@ -40,6 +41,7 @@ feature -- Access feature -- Server launch + -- Launch libFCGI server. local res: INTEGER do @@ -56,6 +58,7 @@ feature -- Server feature -- Execution process_fcgi_request (vars: STRING_TABLE [READABLE_STRING_8]; a_input: like input; a_output: like output) + -- Process the request with variables `vars', input `a_input' and output `a_output'. local req: WGI_REQUEST_FROM_TABLE res: detachable WGI_RESPONSE_STREAM @@ -82,8 +85,9 @@ feature -- Execution retry end end - + process_rescue (res: detachable WGI_RESPONSE) + -- Handle rescued execution of current request. do if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.trace as l_trace then if res /= Void then @@ -116,7 +120,7 @@ invariant fcgi_attached: fcgi /= Void note - copyright: "2011-2013, Eiffel Software and others" + copyright: "2011-2015, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_connection_handler.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_connection_handler.e index 9b32f4a2..5bc857c4 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_connection_handler.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_connection_handler.e @@ -23,6 +23,7 @@ feature {NONE} -- Initialization feature -- Access is_shutdown_requested: BOOLEAN + -- shutdown_requested (a_server: like server): BOOLEAN do diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_connection_handler.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_connection_handler.e index 0b28c038..757d46bd 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_connection_handler.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_connection_handler.e @@ -97,19 +97,13 @@ feature {HTTPD_SERVER_I} -- Execution end process_handler (hdl: separate HTTPD_REQUEST_HANDLER) - -- Process request handler `hdl' with exclusive access. + -- Process request handler `hdl' concurrently. require hdl.is_connected do hdl.safe_execute end - separate_client_socket (hdl: separate HTTPD_REQUEST_HANDLER): separate HTTPD_STREAM_SOCKET - -- Separate client socket from a request handler `hdl'. - do - Result := hdl.client_socket - end - feature {HTTPD_SERVER_I} -- Status report wait_for_completion @@ -128,6 +122,12 @@ feature {HTTPD_SERVER_I} -- Status report feature {NONE} -- Implementation + separate_client_socket (hdl: separate HTTPD_REQUEST_HANDLER): separate HTTPD_STREAM_SOCKET + -- Client socket for handler `hdl'. + do + Result := hdl.client_socket + end + pool: separate CONCURRENT_POOL [HTTPD_REQUEST_HANDLER] -- Pool of separate connection handlers. diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_request_handler.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_request_handler.e index 4055f7e2..9335e76f 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_request_handler.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_request_handler.e @@ -23,6 +23,7 @@ inherit feature {CONCURRENT_POOL, HTTPD_CONNECTION_HANDLER_I} -- Basic operation release + -- local d: STRING do diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool.e index 90a75855..070f2710 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool.e @@ -24,24 +24,32 @@ feature {NONE} -- Initialization feature -- Access count: INTEGER + -- Number of concurrent items managed by Current pool. + + capacity: INTEGER + -- Maximum number of concurrent items managed by Current pool. + +feature -- Status report is_full: BOOLEAN + -- Pool is full? do Result := count >= capacity end is_empty: BOOLEAN + -- No concurrent item waiting in current pool. do Result := count = 0 end - capacity: INTEGER - stop_requested: BOOLEAN + -- Current pool received a request to terminate. feature -- Access separate_item (a_factory: separate CONCURRENT_POOL_FACTORY [G]): detachable separate G + -- Reused, or new separate item of type {G} created by `a_factory'. require is_not_full: not is_full local @@ -94,6 +102,7 @@ feature -- Access feature -- Basic operation gracefull_stop + -- Request the Current pool to terminate. do stop_requested := True end @@ -101,8 +110,10 @@ feature -- Basic operation feature {NONE} -- Internal items: SPECIAL [detachable separate G] + -- List of concurrent items. busy_items: SPECIAL [BOOLEAN] + -- Map of items being proceed. feature {CONCURRENT_POOL_ITEM} -- Change @@ -140,6 +151,7 @@ feature {CONCURRENT_POOL_ITEM} -- Change feature -- Change set_count (n: INTEGER) + -- Set capacity of Current pool to `n'. local g: detachable separate G do @@ -149,6 +161,7 @@ feature -- Change end terminate + -- Terminate current pool. local l_items: like items do @@ -159,6 +172,7 @@ feature -- Change feature {NONE} -- Implementation register_item (a_item: separate G) + -- Adopt `a_item' in current pool. do a_item.set_pool (Current) end diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_item.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_item.e index f0af2268..2b5d1c6b 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_item.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_item.e @@ -25,6 +25,7 @@ feature {CONCURRENT_POOL} -- Change feature {CONCURRENT_POOL, HTTPD_CONNECTION_HANDLER_I} -- Basic operation release + -- Release Current pool item from associated pool. do if attached pool as p then pool_release (p) diff --git a/library/server/wsf_html/widget/wsf_widget_agent_table.e b/library/server/wsf_html/widget/wsf_widget_agent_table.e index 3d8fc16b..c9f42c52 100644 --- a/library/server/wsf_html/widget/wsf_widget_agent_table.e +++ b/library/server/wsf_html/widget/wsf_widget_agent_table.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - WSF_WIDGET_AGENT_TABLE [G] + WSF_WIDGET_AGENT_TABLE [G -> detachable ANY] inherit WSF_WIDGET diff --git a/tests/all-safe.ecf b/tests/all-safe.ecf index de7fb826..84a9e075 100644 --- a/tests/all-safe.ecf +++ b/tests/all-safe.ecf @@ -1,5 +1,5 @@ - + Integration project including many lib @@ -51,14 +51,19 @@ + + - - + + + Compiling with SCOOP concurrency + + Compiling as Windows , on other platforms than Windows