Re: [grpc-io] Scala to Python using gRPC

2019-01-30 Thread S SATHISH BABU
Hello Lidi Zheng,

Actually, the python server is not receiving any request when using a 
asynhronous stub. But in case of blocking stub, it receives the request. 
Does it have to do anything with the executors at the python side?.

Regards,
S Sathish Babu

On Wednesday, 30 January 2019 23:37:04 UTC+5:30, Lidi Zheng wrote:
>
> Hello,
>
> The Scala client is exiting too quick that the future is not yet 
> completed. You may use "Await.ready" or "Await.result" to explicitly block 
> the program.
>
> Cheers,
> Lidi Zheng
>
> On Tue, Jan 29, 2019 at 10:58 PM S SATHISH BABU  > wrote:
>
>> Hello,
>> I am making a communication between my Scala gRPC client and python 
>> gRPC server. My issue is when I make a blocking call from scala client, my 
>> request is handled. But in case of asynchronous stub, the request is not 
>> delivered at all. Can anyone help me out with this?.
>>
>> Python gRPC server code
>>
>> from gRPC2 import message_pb2, message_pb2_grpc
>> import grpc
>> from concurrent import futures
>> import time
>>
>>
>> class HandlerServicer(message_pb2_grpc.HandlerServicer):
>>
>> def request_handler(self, request, context):
>> print('Received request:', request, request.request_message)
>> response = 'Reponse'
>> time.sleep(10)
>> return message_pb2.Response(response_message=response)
>>
>>
>> handler_server = grpc.server(futures.ThreadPoolExecutor())
>> message_pb2_grpc.add_HandlerServicer_to_server(HandlerServicer(), 
>> handler_server)
>> handler_server.add_insecure_port("[::]:{}".format(5000))
>>
>> print('Starting server...')
>> handler_server.start()
>> try:
>> while True:
>> time.sleep(60*60*60)
>> except KeyboardInterrupt:
>> print('Stopping server...')
>> handler_server.stop(0)
>>
>>
>> Scala gRPC client code:
>>
>> import io.grpc.ManagedChannelBuilder
>> import message._
>>
>> import scala.concurrent.Future
>> import scala.concurrent.ExecutionContext
>>
>> object HandlerClient extends App {
>>
>>   val channel = ManagedChannelBuilder.forAddress("localhost", 
>> 5000).usePlaintext().build()
>>   val request = Request("Request")
>>   implicit val ec = ExecutionContext.global
>>
>>   // Making a Async call
>>   val stub = HandlerGrpc.stub(channel)
>>   val future = stub.requestHandler(request)
>>   future onComplete println
>> }
>>
>>
>>
>> Proto file:
>>
>> syntax = "proto3";
>>
>> service Handler{
>> rpc request_handler(Request) returns (Response){}
>> }
>>
>> message Request{
>> string request_message = 1;
>> }
>>
>> message Response{
>> string response_message = 1;
>> }
>>
>>
>> Thanks,
>> S Sathish Babu
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to grpc-io+u...@googlegroups.com .
>> To post to this group, send email to grp...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/grpc-io.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/4ce6fa34-b5a5-49d0-9296-b6c25cdc33ae%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/0f33d2c4-5837-437a-9e7d-5ac0411c082a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] Scala to Python using gRPC

2019-01-30 Thread S SATHISH BABU
Hello Lidi Zheng,

I couldn't get your point.

Regards,
S Sathish Babu

On Thursday, 31 January 2019 10:10:30 UTC+5:30, Lidi Zheng wrote:
>
> Hi S Sathish Babu,
>
> In that case, you want to keep your main thread alive after you dispatched 
> your premises. I presume in Scala the "Future" works fine with 
> "Thread.sleep"? If so, you may block your main thread by explicitly calling 
> "Thread.sleep" at the end of your main function, and your premises will be 
> executed asynchronously.
>
> Cheers,
> Lidi Zheng
>
> On Wed, Jan 30, 2019 at 8:07 PM S SATHISH BABU  > wrote:
>
>> Hello Lidi Zheng,
>>
>> Thanks for the response. As you said,using "Await.ready" or "Await.block" 
>> will block the program and return me the result. In my case, I want it to 
>> execute asynchronously. There should be no blocking. Let the server return 
>> the response when it has finished computing. Is that possible?
>>
>> Regards,
>> S Sathish Babu
>>
>> On Wednesday, 30 January 2019 23:37:04 UTC+5:30, Lidi Zheng wrote:
>>>
>>> Hello,
>>>
>>> The Scala client is exiting too quick that the future is not yet 
>>> completed. You may use "Await.ready" or "Await.result" to explicitly block 
>>> the program.
>>>
>>> Cheers,
>>> Lidi Zheng
>>>
>>> On Tue, Jan 29, 2019 at 10:58 PM S SATHISH BABU  
>>> wrote:
>>>
 Hello,
 I am making a communication between my Scala gRPC client and python 
 gRPC server. My issue is when I make a blocking call from scala client, my 
 request is handled. But in case of asynchronous stub, the request is not 
 delivered at all. Can anyone help me out with this?.

 Python gRPC server code

 from gRPC2 import message_pb2, message_pb2_grpc
 import grpc
 from concurrent import futures
 import time


 class HandlerServicer(message_pb2_grpc.HandlerServicer):

 def request_handler(self, request, context):
 print('Received request:', request, request.request_message)
 response = 'Reponse'
 time.sleep(10)
 return message_pb2.Response(response_message=response)


 handler_server = grpc.server(futures.ThreadPoolExecutor())
 message_pb2_grpc.add_HandlerServicer_to_server(HandlerServicer(), 
 handler_server)
 handler_server.add_insecure_port("[::]:{}".format(5000))

 print('Starting server...')
 handler_server.start()
 try:
 while True:
 time.sleep(60*60*60)
 except KeyboardInterrupt:
 print('Stopping server...')
 handler_server.stop(0)


 Scala gRPC client code:

 import io.grpc.ManagedChannelBuilder
 import message._

 import scala.concurrent.Future
 import scala.concurrent.ExecutionContext

 object HandlerClient extends App {

   val channel = ManagedChannelBuilder.forAddress("localhost", 
 5000).usePlaintext().build()
   val request = Request("Request")
   implicit val ec = ExecutionContext.global

   // Making a Async call
   val stub = HandlerGrpc.stub(channel)
   val future = stub.requestHandler(request)
   future onComplete println
 }



 Proto file:

 syntax = "proto3";

 service Handler{
 rpc request_handler(Request) returns (Response){}
 }

 message Request{
 string request_message = 1;
 }

 message Response{
 string response_message = 1;
 }


 Thanks,
 S Sathish Babu

 -- 
 You received this message because you are subscribed to the Google 
 Groups "grpc.io" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to grpc-io+u...@googlegroups.com.
 To post to this group, send email to grp...@googlegroups.com.
 Visit this group at https://groups.google.com/group/grpc-io.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/grpc-io/4ce6fa34-b5a5-49d0-9296-b6c25cdc33ae%40googlegroups.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to grpc-io+u...@googlegroups.com .
>> To post to this group, send email to grp...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/grpc-io.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/2000128c-39d2-44ea-82f0-e9c5af3ed07e%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received

Re: [grpc-io] Scala to Python using gRPC

2019-01-30 Thread 'Lidi Zheng' via grpc.io
Hi S Sathish Babu,

In that case, you want to keep your main thread alive after you dispatched
your premises. I presume in Scala the "Future" works fine with
"Thread.sleep"? If so, you may block your main thread by explicitly calling
"Thread.sleep" at the end of your main function, and your premises will be
executed asynchronously.

Cheers,
Lidi Zheng

On Wed, Jan 30, 2019 at 8:07 PM S SATHISH BABU 
wrote:

> Hello Lidi Zheng,
>
> Thanks for the response. As you said,using "Await.ready" or "Await.block"
> will block the program and return me the result. In my case, I want it to
> execute asynchronously. There should be no blocking. Let the server return
> the response when it has finished computing. Is that possible?
>
> Regards,
> S Sathish Babu
>
> On Wednesday, 30 January 2019 23:37:04 UTC+5:30, Lidi Zheng wrote:
>>
>> Hello,
>>
>> The Scala client is exiting too quick that the future is not yet
>> completed. You may use "Await.ready" or "Await.result" to explicitly block
>> the program.
>>
>> Cheers,
>> Lidi Zheng
>>
>> On Tue, Jan 29, 2019 at 10:58 PM S SATHISH BABU 
>> wrote:
>>
>>> Hello,
>>> I am making a communication between my Scala gRPC client and python
>>> gRPC server. My issue is when I make a blocking call from scala client, my
>>> request is handled. But in case of asynchronous stub, the request is not
>>> delivered at all. Can anyone help me out with this?.
>>>
>>> Python gRPC server code
>>>
>>> from gRPC2 import message_pb2, message_pb2_grpc
>>> import grpc
>>> from concurrent import futures
>>> import time
>>>
>>>
>>> class HandlerServicer(message_pb2_grpc.HandlerServicer):
>>>
>>> def request_handler(self, request, context):
>>> print('Received request:', request, request.request_message)
>>> response = 'Reponse'
>>> time.sleep(10)
>>> return message_pb2.Response(response_message=response)
>>>
>>>
>>> handler_server = grpc.server(futures.ThreadPoolExecutor())
>>> message_pb2_grpc.add_HandlerServicer_to_server(HandlerServicer(), 
>>> handler_server)
>>> handler_server.add_insecure_port("[::]:{}".format(5000))
>>>
>>> print('Starting server...')
>>> handler_server.start()
>>> try:
>>> while True:
>>> time.sleep(60*60*60)
>>> except KeyboardInterrupt:
>>> print('Stopping server...')
>>> handler_server.stop(0)
>>>
>>>
>>> Scala gRPC client code:
>>>
>>> import io.grpc.ManagedChannelBuilder
>>> import message._
>>>
>>> import scala.concurrent.Future
>>> import scala.concurrent.ExecutionContext
>>>
>>> object HandlerClient extends App {
>>>
>>>   val channel = ManagedChannelBuilder.forAddress("localhost", 
>>> 5000).usePlaintext().build()
>>>   val request = Request("Request")
>>>   implicit val ec = ExecutionContext.global
>>>
>>>   // Making a Async call
>>>   val stub = HandlerGrpc.stub(channel)
>>>   val future = stub.requestHandler(request)
>>>   future onComplete println
>>> }
>>>
>>>
>>>
>>> Proto file:
>>>
>>> syntax = "proto3";
>>>
>>> service Handler{
>>> rpc request_handler(Request) returns (Response){}
>>> }
>>>
>>> message Request{
>>> string request_message = 1;
>>> }
>>>
>>> message Response{
>>> string response_message = 1;
>>> }
>>>
>>>
>>> Thanks,
>>> S Sathish Babu
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "grpc.io" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to grpc-io+u...@googlegroups.com.
>>> To post to this group, send email to grp...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/grpc-io.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/grpc-io/4ce6fa34-b5a5-49d0-9296-b6c25cdc33ae%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To post to this group, send email to grpc-io@googlegroups.com.
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/2000128c-39d2-44ea-82f0-e9c5af3ed07e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
T

Re: [grpc-io] Scala to Python using gRPC

2019-01-30 Thread S SATHISH BABU
Hello Lidi Zheng,

Thanks for the response. As you said,using "Await.ready" or "Await.block" 
will block the program and return me the result. In my case, I want it to 
execute asynchronously. There should be no blocking. Let the server return 
the response when it has finished computing. Is that possible?

Regards,
S Sathish Babu

On Wednesday, 30 January 2019 23:37:04 UTC+5:30, Lidi Zheng wrote:
>
> Hello,
>
> The Scala client is exiting too quick that the future is not yet 
> completed. You may use "Await.ready" or "Await.result" to explicitly block 
> the program.
>
> Cheers,
> Lidi Zheng
>
> On Tue, Jan 29, 2019 at 10:58 PM S SATHISH BABU  > wrote:
>
>> Hello,
>> I am making a communication between my Scala gRPC client and python 
>> gRPC server. My issue is when I make a blocking call from scala client, my 
>> request is handled. But in case of asynchronous stub, the request is not 
>> delivered at all. Can anyone help me out with this?.
>>
>> Python gRPC server code
>>
>> from gRPC2 import message_pb2, message_pb2_grpc
>> import grpc
>> from concurrent import futures
>> import time
>>
>>
>> class HandlerServicer(message_pb2_grpc.HandlerServicer):
>>
>> def request_handler(self, request, context):
>> print('Received request:', request, request.request_message)
>> response = 'Reponse'
>> time.sleep(10)
>> return message_pb2.Response(response_message=response)
>>
>>
>> handler_server = grpc.server(futures.ThreadPoolExecutor())
>> message_pb2_grpc.add_HandlerServicer_to_server(HandlerServicer(), 
>> handler_server)
>> handler_server.add_insecure_port("[::]:{}".format(5000))
>>
>> print('Starting server...')
>> handler_server.start()
>> try:
>> while True:
>> time.sleep(60*60*60)
>> except KeyboardInterrupt:
>> print('Stopping server...')
>> handler_server.stop(0)
>>
>>
>> Scala gRPC client code:
>>
>> import io.grpc.ManagedChannelBuilder
>> import message._
>>
>> import scala.concurrent.Future
>> import scala.concurrent.ExecutionContext
>>
>> object HandlerClient extends App {
>>
>>   val channel = ManagedChannelBuilder.forAddress("localhost", 
>> 5000).usePlaintext().build()
>>   val request = Request("Request")
>>   implicit val ec = ExecutionContext.global
>>
>>   // Making a Async call
>>   val stub = HandlerGrpc.stub(channel)
>>   val future = stub.requestHandler(request)
>>   future onComplete println
>> }
>>
>>
>>
>> Proto file:
>>
>> syntax = "proto3";
>>
>> service Handler{
>> rpc request_handler(Request) returns (Response){}
>> }
>>
>> message Request{
>> string request_message = 1;
>> }
>>
>> message Response{
>> string response_message = 1;
>> }
>>
>>
>> Thanks,
>> S Sathish Babu
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to grpc-io+u...@googlegroups.com .
>> To post to this group, send email to grp...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/grpc-io.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/4ce6fa34-b5a5-49d0-9296-b6c25cdc33ae%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/2000128c-39d2-44ea-82f0-e9c5af3ed07e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: CERTIFICATE_VERIFY_FAILED in OpenSuse leap 15.0

2019-01-30 Thread 'Srini Polavarapu' via grpc.io
The root CA cert is bundled with gRPC that is used by Speech library. To 
point to your own root CA cert, you can try setting the env variable 
"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH=/your/path/to/CAcert"

On Monday, January 28, 2019 at 3:25:23 AM UTC-8, rohan@matrixcomsec.com 
wrote:
>
> Hi all,
> I am using the openSuse leap 15.0 to develop the Google speech recognition 
> program. I am using the cpp-doc-samples at 
> https://github.com/GoogleCloudPlatform/cpp-docs-samples
> as the starting point. I am trying to make the tests as `make run_tests` 
> but I am getting stuck at the SSL handshake.
>
> The error shown is: 
> E0128 15:20:51.1915766087156 ssl_transport_security.cc:1233] Handshake 
> failed with fatal error SSL_ERROR_SSL: error:107d:SSL routines:
> OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.
>
> I have checked that my browser is working properly with *https://* pages. 
> I would like to mention that my network is monitored and handled by 
> security framework which comes with its SSL (CA) certificates.
>
> I am guessing that the security framework is the cause of above error. I 
> am not sure which certificate to update though. I am assuming that the 
> Google cpp sample mentioned above would be pointing to some certificate to 
> do the SSL handshake, but is not getting it. so I will have to manually 
> give those CA certificates on the location or may be change the location to 
> point on these certificates.
>
> Can someone help me on how to do that. (its OK if you have nothing to 
> refer regarding OpenSuse) I am looking for mainly the File/ certificate 
> that the program needs and where to find it.
>
> Regards to all, Thank you
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/3d678c3c-4dc2-4dd2-89d0-e540137c8a6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] Scala to Python using gRPC

2019-01-30 Thread 'Lidi Zheng' via grpc.io
Hello,

The Scala client is exiting too quick that the future is not yet completed.
You may use "Await.ready" or "Await.result" to explicitly block the program.

Cheers,
Lidi Zheng

On Tue, Jan 29, 2019 at 10:58 PM S SATHISH BABU 
wrote:

> Hello,
> I am making a communication between my Scala gRPC client and python
> gRPC server. My issue is when I make a blocking call from scala client, my
> request is handled. But in case of asynchronous stub, the request is not
> delivered at all. Can anyone help me out with this?.
>
> Python gRPC server code
>
> from gRPC2 import message_pb2, message_pb2_grpc
> import grpc
> from concurrent import futures
> import time
>
>
> class HandlerServicer(message_pb2_grpc.HandlerServicer):
>
> def request_handler(self, request, context):
> print('Received request:', request, request.request_message)
> response = 'Reponse'
> time.sleep(10)
> return message_pb2.Response(response_message=response)
>
>
> handler_server = grpc.server(futures.ThreadPoolExecutor())
> message_pb2_grpc.add_HandlerServicer_to_server(HandlerServicer(), 
> handler_server)
> handler_server.add_insecure_port("[::]:{}".format(5000))
>
> print('Starting server...')
> handler_server.start()
> try:
> while True:
> time.sleep(60*60*60)
> except KeyboardInterrupt:
> print('Stopping server...')
> handler_server.stop(0)
>
>
> Scala gRPC client code:
>
> import io.grpc.ManagedChannelBuilder
> import message._
>
> import scala.concurrent.Future
> import scala.concurrent.ExecutionContext
>
> object HandlerClient extends App {
>
>   val channel = ManagedChannelBuilder.forAddress("localhost", 
> 5000).usePlaintext().build()
>   val request = Request("Request")
>   implicit val ec = ExecutionContext.global
>
>   // Making a Async call
>   val stub = HandlerGrpc.stub(channel)
>   val future = stub.requestHandler(request)
>   future onComplete println
> }
>
>
>
> Proto file:
>
> syntax = "proto3";
>
> service Handler{
> rpc request_handler(Request) returns (Response){}
> }
>
> message Request{
> string request_message = 1;
> }
>
> message Response{
> string response_message = 1;
> }
>
>
> Thanks,
> S Sathish Babu
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To post to this group, send email to grpc-io@googlegroups.com.
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/4ce6fa34-b5a5-49d0-9296-b6c25cdc33ae%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAMC1%3DjfORqABJ5-pkxGeRxKME%3DYr_w89s%2BRDoHoiKYbDEkRqWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] Help with gRpc Error (call is closed)

2019-01-30 Thread grpc-noob
thanks George

On Monday, January 28, 2019 at 7:13:46 AM UTC-8, George Gensure wrote:
>
> Your client has closed the connection, which was received by the grpc 
> server layer and closed the ServerCall it maintains. For (presumably) long 
> lived connections, you should establish a cancellation listener on your 
> current Context from within the initial method which cancels any incomplete 
> futures, wrap any asynchronously executed scopes with that context::wrap 
> with Context.current().isCancelled() tests within them to avoid 
> communicating with the responseObserver if cancelled. On another async 
> style note, your future.get() with Interrupted/Execution handling there 
> would be better suited for a Futures.transform on your responseService that 
> invokes responseObserver.onNext with the result.
>
> Cheers!
> -George
>
> On Mon, Jan 28, 2019 at 2:14 AM grpc-noob > 
> wrote:
>
>> Hi folks,
>>
>> I am pretty noob with gRpc and trying to make bidirectional streaming 
>> work with ListenableFutures.
>>
>> My code is as follows:
>>
>> RequestService requestService = MoreExecutors.
>> *listeningDecorator*(MyExecutor) ;
>> ResponseService responseService = MoreExecutors.
>> *listeningDecorator*(MyExecutor) ;
>>
>> @Override
>> public StreamObserver ingestEventsStreaming(
>> StreamObserver responseObserver) { 
>> return new StreamObserver() { 
>> @Override 
>> public void onNext(Request request) { 
>> ListenableFuture listenableFuture 
>> = requestService.submit( new RequestHandlerTask(config)); 
>>
>> listenableFuture.addListener(new Runnable() { 
>> @Override 
>> public void run() { 
>> try { 
>> responseObserver.onNext(listenableFuture.get()); 
>> } catch (InterruptedException e) { 
>>   LOG.error("Interrupted", e); 
>> } catch (ExecutionException e) { 
>>   LOG.error("Exception in task", e.getCause()); 
>> } 
>>  }  }, responseService); 
>> } 
>>
>> @Override 
>> public void onError(Throwable t) { 
>> LOG.warn(“Request Failed"); 
>> } 
>>
>> @Override 
>> public void onCompleted() { 
>> responseObserver.onCompleted(); 
>> } 
>> }; 
>> }
>>
>>
>>
>> Above code throws following exception:
>>
>>
>> Exception in thread "pool-3-thread-1" Exception in thread 
>> "pool-3-thread-3" java.lang.IllegalStateException: call is closed
>>
>> at com.google.common.base.Preconditions.checkState(Preconditions.java:510)
>>
>> at io.grpc.internal.ServerCallImpl.sendHeaders(ServerCallImpl.java:89)
>>
>> at 
>> io.grpc.stub.ServerCalls$ServerCallStreamObserverImpl.onNext(ServerCalls.java:338)
>>
>> at 
>> com.paloaltonetworks.apollo2.ingestion.frontend.server.FrontendServer$FrontendService$1$1.run(FrontendServer.java:160)
>>
>> at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>
>> at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>
>> at java.lang.Thread.run(Thread.java:748)
>>
>>
>>
>> It seems that adding listener fails the code. 
>>
>>
>> May I know if I am doing anything wrong ? Any help will be much 
>> appreciated.
>>
>>
>> Thanks,
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to grpc-io+u...@googlegroups.com .
>> To post to this group, send email to grp...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/grpc-io.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/1ae15b1d-c7fc-46d8-affa-c13d10fa0af3%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/96ab029c-4591-40ac-a5eb-b96023eca2b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.