Exemplo n.º 1
0
 /// <summary>
 /// Keeps track of any watchers that are set by the request.
 /// </summary>
 /// <param name="request">Request to track</param>
 /// <returns>The request call</returns>
 internal static RequestCall LocalRequest(RequestDefinitions.IRingMasterRequest request)
 {
     return(new RequestCall()
     {
         Request = BackendRequest.Wrap(request),
     });
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestMulti"/> class.
 /// </summary>
 /// <param name="request">The request to wrap</param>
 /// <param name="context">Context associated with the request</param>
 /// <param name="callback">Callback to invoke when the request is completed</param>
 internal RequestMulti(
     RequestDefinitions.RequestMulti request,
     object context,
     OpsResultCallbackDelegate callback)
     : base(request, BackendRequest.Wrap(request.Requests), context, callback)
 {
 }
Exemplo n.º 3
0
        /// <summary>
        /// Recreates a request from its on-wire representation.
        /// </summary>
        /// <param name="requestBytes">Data to deserialize</param>
        /// <returns>Deserialized request</returns>
        public RequestCall DeserializeRequestFromBytes(byte[] requestBytes)
        {
            if (requestBytes == null)
            {
                throw new ArgumentNullException(nameof(requestBytes));
            }

            // Before deserializing, check if the request specifies a watcher.  If it does, create a proxy watcher and add an entry to
            // the tracking data structure.  When proxyWatcher.Process is called by the backend, the corresponding message with WatcherCall
            // will be sent to the other side.
            RequestDefinitions.RequestCall call = this.protocol.DeserializeRequest(requestBytes, requestBytes.Length, this.UsedMarshalVersion);

            this.RegisterWatcher(call.Request, this.RegisterProxyWatcher);

            return(new RequestCall()
            {
                CallId = call.CallId,
                Request = BackendRequest.Wrap(call.Request),
            });
        }