You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
En interceptor necesito entender si un mensaje está siendo enviado o recibido, pero realmente no he descubierto cómo. He visto tipos StreaminType, pero estos, según tengo entendido, se encargan de saber de dónde viene el mensaje, no si se envía o no. ¿Alguien sabe cómo obtener esta información?
The text was updated successfully, but these errors were encountered:
In an interceptor I need to understand if a message is being sent or received, but I haven't really figured out how. I have seen StreamingType types, but these, as I understand it, are responsible for knowing where the message comes from, not whether it is sent or not. Does anyone know how to obtain this information?
In an interceptor, you can look at request.Spec().IsClient to see if the interceptor is called in a client (if false, the interceptor is being called in a server handler). In a client, the request message is being "sent" and the response is "received". In a server handler, it's the opposite: the request message is "received" and the response is "sent".
For the stream interceptor functions, you'll have (and can wrap) a StreamingClientConn or StreamingHandlerConn (depending on whether the interceptor is being called in a client or a server handler). These have methods named Send and Receive which make the transmission direction very clear.
En interceptor necesito entender si un mensaje está siendo enviado o recibido, pero realmente no he descubierto cómo. He visto tipos
StreaminType
, pero estos, según tengo entendido, se encargan de saber de dónde viene el mensaje, no si se envía o no. ¿Alguien sabe cómo obtener esta información?The text was updated successfully, but these errors were encountered: