Class: Griffin::Interceptors::Server::PayloadStreamer
- Inherits:
-
CallStream
- Object
- GrpcKit::Call
- CallStream
- Griffin::Interceptors::Server::PayloadStreamer
- Defined in:
- lib/griffin/interceptors/server/payload_streamer.rb
Instance Method Summary collapse
-
#initialize(inner, logger, base_log = {}, filter = nil) ⇒ PayloadStreamer
constructor
A new instance of PayloadStreamer.
- #recv ⇒ Object
- #send_msg(msg) ⇒ Object
Methods inherited from CallStream
Constructor Details
#initialize(inner, logger, base_log = {}, filter = nil) ⇒ PayloadStreamer
Returns a new instance of PayloadStreamer.
12 13 14 15 16 17 |
# File 'lib/griffin/interceptors/server/payload_streamer.rb', line 12 def initialize(inner, logger, base_log = {}, filter = nil) super(inner) @logger = logger @filter = filter @base_log = base_log end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Griffin::Interceptors::CallStream
Instance Method Details
#recv ⇒ Object
24 25 26 27 28 |
# File 'lib/griffin/interceptors/server/payload_streamer.rb', line 24 def recv super.tap do |req| @logger.info(@base_log.merge('grpc.request.content' => extract_content(req))) end end |
#send_msg(msg) ⇒ Object
19 20 21 22 |
# File 'lib/griffin/interceptors/server/payload_streamer.rb', line 19 def send_msg(msg) @logger.info(@base_log.merge('grpc.response.content' => extract_content(msg))) super end |