.flatMap(implementation.sayHello(_, metadata))
        .map(e =&gt; GrpcMarshalling.marshal(e, eHandler)(HelloReplySerializer, mat, responseCodec, system))
    
    case &quot;ItKeepsTalking&quot; =&gt;
     // ....
  }
  // ....
}
</code></pre>
<p><code>case &quot;SayHello&quot; =&gt;</code>模式匹配既是构造<code>Metadata</code>和执行<code>SayHello</code>gRPC服务的代码逻辑。<code>val metadata = new MetadataImpl(request.headers)</code>一行代码通过<code>request.headers</code>构造了