Index: third_party/grpc/src/python/grpcio/grpc/framework/core/implementations.py |
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/echo_wsh.py b/third_party/grpc/src/python/grpcio/grpc/framework/core/implementations.py |
similarity index 52% |
copy from third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/echo_wsh.py |
copy to third_party/grpc/src/python/grpcio/grpc/framework/core/implementations.py |
index 429f58186e3fce43dc21e81e0f9d7e20c7e0bf70..364a7faed4093a7cfd92070dea9de423b386e0a1 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/echo_wsh.py |
+++ b/third_party/grpc/src/python/grpcio/grpc/framework/core/implementations.py |
@@ -1,4 +1,4 @@ |
-# Copyright 2010, Google Inc. |
+# Copyright 2015, Google Inc. |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
@@ -27,20 +27,36 @@ |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+"""Entry points into the ticket-exchange-based base layer implementation.""" |
-from mod_pywebsocket import msgutil |
+# base and links are referenced from specification in this module. |
+from grpc.framework.core import _end |
+from grpc.framework.interfaces.base import base # pylint: disable=unused-import |
+from grpc.framework.interfaces.links import links # pylint: disable=unused-import |
-_GOODBYE_MESSAGE = 'Goodbye' |
+def invocation_end_link(): |
+ """Creates a base.End-links.Link suitable for operation invocation. |
+ Returns: |
+ An object that is both a base.End and a links.Link, that supports operation |
+ invocation, and that translates operation invocation into ticket exchange. |
+ """ |
+ return _end.serviceless_end_link() |
-def web_socket_do_extra_handshake(request): |
- pass # Always accept. |
+def service_end_link(servicer, default_timeout, maximum_timeout): |
+ """Creates a base.End-links.Link suitable for operation service. |
-def web_socket_transfer_data(request): |
- while True: |
- line = msgutil.receive_message(request) |
- msgutil.send_message(request, line) |
- if line == _GOODBYE_MESSAGE: |
- return |
+ Args: |
+ servicer: A base.Servicer for servicing operations. |
+ default_timeout: A length of time in seconds to be used as the default |
+ time alloted for a single operation. |
+ maximum_timeout: A length of time in seconds to be used as the maximum |
+ time alloted for a single operation. |
+ |
+ Returns: |
+ An object that is both a base.End and a links.Link and that services |
+ operations that arrive at it through ticket exchange. |
+ """ |
+ return _end.serviceful_end_link(servicer, default_timeout, maximum_timeout) |