[ 
https://issues.apache.org/jira/browse/BEAM-8335?focusedWorklogId=353689&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-353689
 ]

ASF GitHub Bot logged work on BEAM-8335:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Dec/19 19:29
            Start Date: 04/Dec/19 19:29
    Worklog Time Spent: 10m 
      Work Description: rohdesamuel commented on pull request #10120: 
[BEAM-8335] Add a TestStreamService Python Implementation
URL: https://github.com/apache/beam/pull/10120#discussion_r353936441
 
 

 ##########
 File path: sdks/python/apache_beam/testing/test_stream_service.py
 ##########
 @@ -0,0 +1,55 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from __future__ import absolute_import
+
+from concurrent.futures import ThreadPoolExecutor
+
+import grpc
+
+from apache_beam.portability.api import beam_runner_api_pb2_grpc
+from apache_beam.portability.api.beam_runner_api_pb2_grpc import 
TestStreamServiceServicer
+
+
+class TestStreamServiceController(TestStreamServiceServicer):
+  def __init__(self, events, endpoint=None):
+    self._server = grpc.server(ThreadPoolExecutor(max_workers=10))
+
+    if endpoint:
+      self.endpoint = endpoint
+      self._server.add_insecure_port(self.endpoint)
+    else:
+      port = self._server.add_insecure_port('[::]:0')
+      self.endpoint = '[::]:{}'.format(port)
+
+    beam_runner_api_pb2_grpc.add_TestStreamServiceServicer_to_server(
+        self, self._server)
+    self._events = events
+
+  def start(self):
+    self._server.start()
+
+  def stop(self):
+    self._server.stop(0)
+    self._server.wait_for_termination()
+
+  def Events(self, request, context):
+    """Streams back all of the events from the streaming cache."""
+
+    events = self._events()
+    for e in events:
 
 Review comment:
   I originally thought it would be nice for this to be lazy, but you made a 
good point that it can be done in the \_\_iter\_\_ method. That way makes more 
sense.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 353689)
    Time Spent: 41.5h  (was: 41h 20m)

> Add streaming support to Interactive Beam
> -----------------------------------------
>
>                 Key: BEAM-8335
>                 URL: https://issues.apache.org/jira/browse/BEAM-8335
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-py-interactive
>            Reporter: Sam Rohde
>            Assignee: Sam Rohde
>            Priority: Major
>          Time Spent: 41.5h
>  Remaining Estimate: 0h
>
> This issue tracks the work items to introduce streaming support to the 
> Interactive Beam experience. This will allow users to:
>  * Write and run a streaming job in IPython
>  * Automatically cache records from unbounded sources
>  * Add a replay experience that replays all cached records to simulate the 
> original pipeline execution
>  * Add controls to play/pause/stop/step individual elements from the cached 
> records
>  * Add ability to inspect/visualize unbounded PCollections



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to