basant307/AI_Governance_Project
048
1"use strict";2 3/**4 * Streaming RPC helpers.5 * @namespace6 */7var rpc = exports;8 9/**10 * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.11 * @typedef RPCImpl12 * @type {function}13 * @param {Method|rpc.ServiceMethod<Message<{}>,Message<{}>>} method Reflected or static method being called14 * @param {Uint8Array} requestData Request data15 * @param {RPCImplCallback} callback Callback function16 * @returns {undefined}17 * @example18 * function rpcImpl(method, requestData, callback) {19 * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code20 * throw Error("no such method");21 * asynchronouslyObtainAResponse(requestData, function(err, responseData) {22 * callback(err, responseData);23 * });24 * }25 */26 27/**28 * Node-style callback as used by {@link RPCImpl}.29 * @typedef RPCImplCallback30 * @type {function}31 * @param {Error|null} error Error, if any, otherwise `null`32 * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error33 * @returns {undefined}34 */35 36rpc.Service = require("./rpc/service");37 