Exemplo n.º 1
0
 public IClientInvoker Group(string group)
 {
     return(new ClientInvoker(
                async(methodName, args) => {
         var message = new Message()
         {
             MessageType = MessageType.ClientMethodInvocation,
             Data = MessageSerializer.SerializeObject(new InvocationDescriptor()
             {
                 MethodName = methodName,
                 Arguments = args
             })
         };
         await _backplane.SendMessageGroupAsync(group, message).ConfigureAwait(false);
     },
                async msg => {
         await _backplane.SendMessageAsync(group, msg).ConfigureAwait(false);
     },
                (g) => {
         throw new NotImplementedException();
     },
                (g) => {
         throw new NotImplementedException();
     }));
 }
Exemplo n.º 2
0
 public static Task InvokeAsync(this IBackplane backplane, string connectionId, string methodName, params object[] arguments)
 {
     return(backplane.SendMessageAsync(connectionId, new Message
     {
         MessageType = MessageType.ClientMethodInvocation,
         Data = MessageSerializer.SerializeObject(new InvocationDescriptor()
         {
             MethodName = methodName,
             Arguments = arguments
         })
     }));
 }