src/ruby/lib/grpc/generic/bidi_call.rb
# Begins orchestration of the Bidi stream for a server generating replies.
#
# N.B. gen_each_reply is a func(Enumerable<Requests>)
#
# It takes an enumerable of requests as an arg, in case there is a
# relationship between the stream of requests and the stream of replies.
#
# This does not mean that must necessarily be one.  E.g, the replies
# produced by gen_each_reply could ignore the received_msgs
#
# @param gen_each_reply [Proc] generates the BiDi stream replies.
Begins orchestration of the Bidi stream for a server generating replies.

It takes an enumerable of requests as an arg, in case there is a
relationship between the stream of requests and the stream of replies.

This does not mean that must necessarily be one.  E.g, the replies
produced by gen_each_reply could ignore the received_msgs
Begins orchestration of the Bidi stream for a server generating replies . It takes an enumerable of requests as an arg in case there is a relationship between the stream of requests and the stream of replies . This does not mean that must necessarily be one . E . g the replies produced by gen_each_reply could ignore the received_msgs
def run_on_server(gen_each_reply)
      if gen_each_reply.arity == 1
        replys = gen_each_reply.call(read_loop(is_client: false))
      elsif gen_each_reply.arity == 2
        replys = gen_each_reply.call(read_loop(is_client: false), @req_view)
      else
        fail 'Illegal arity of reply generator'
      end
      write_loop(replys, is_client: false)
    end
def run_on_server ( gen_each_reply ) if gen_each_reply . arity == 1 replys = gen_each_reply . call ( read_loop ( is_client : false ) ) elsif gen_each_reply . arity == 2 replys = gen_each_reply . call ( read_loop ( is_client : false ) , @req_view ) else fail 'Illegal arity of reply generator' end write_loop ( replys , is_client : false ) end
Begins orchestration of the Bidi stream for a server generating replies.
Begins orchestration of the Bidi stream for a server generating replies .
# Pass in the optional call object parameter if possible
gen_each_reply
generates the BiDi stream replies.
generates the BiDi stream replies .