You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/11/02 04:29:00 UTC

[jira] [Work logged] (BEAM-13127) [Playground] Implement TCP listener

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

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

                Author: ASF GitHub Bot
            Created on: 02/Nov/21 04:28
            Start Date: 02/Nov/21 04:28
    Worklog Time Spent: 10m 
      Work Description: pabloem commented on a change in pull request #15838:
URL: https://github.com/apache/beam/pull/15838#discussion_r740710615



##########
File path: playground/backend/cmd/server/server.go
##########
@@ -50,10 +50,16 @@ func runServer() error {
 	})
 
 	grpclog.SetLoggerV2(grpclog.NewLoggerV2(os.Stdout, os.Stdout, os.Stderr))
-	handler := Wrap(grpcServer, getGrpcWebOptions())
+

Review comment:
       asking for an extra change: In line 22 in this file we're importing the Go logging library. Should we be using our own logger?

##########
File path: playground/backend/cmd/server/tcp.go
##########
@@ -0,0 +1,44 @@
+// 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.
+
+package main
+
+import (
+	"beam.apache.org/playground/backend/internal/environment"
+	"beam.apache.org/playground/backend/internal/logger"
+	"context"
+	"google.golang.org/grpc"
+	"net"
+)
+
+// listenTcp binds the grpc.Server to the TCP address
+func listenTcp(ctx context.Context, errChan chan error, envs environment.NetworkEnvs, svc *grpc.Server) {
+	logger.Infof("listening TCP at %s\n", envs.Address())
+	lis, err := net.Listen("tcp", envs.Address())
+	if err != nil {
+		errChan <- err
+		return
+	}
+	if err := svc.Serve(lis); err != nil {
+		errChan <- err
+		return
+	}
+	for {
+		select {
+		case <-ctx.Done():
+			return
+		}

Review comment:
       Just to improve my understanding - what does this do?




-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

    Worklog Id:     (was: 672959)
    Time Spent: 0.5h  (was: 20m)

> [Playground] Implement TCP listener
> -----------------------------------
>
>                 Key: BEAM-13127
>                 URL: https://issues.apache.org/jira/browse/BEAM-13127
>             Project: Beam
>          Issue Type: Task
>          Components: beam-playground
>            Reporter: Pavel Avilov
>            Assignee: Pavel Avilov
>            Priority: P3
>              Labels: beam-playground-backend, beam-playground-sprint-3
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Сreate a TCP listener which binds with the Playground gRPC server. 
>  This listener is wanted for easy testing of server endpoints. The choice type of listener (http or tcp) depends on the value of the environment variable ("protocolTypeKey"). Tools like this  [grpcox|https://github.com/gusaul/grpcoxcan]  can be used to manually test the gRPC server



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