public static ValueTask SendWelcome(this IGrpcNode node, IGrpcHostNode hostNode) { return(node.Writer.WriteAsync(new TransportMessage { Welcome = new Welcome { Node = new Node().Initialize(hostNode) } })); }
public GrpcClient(IGrpcHostConfiguration hostConfiguration, IGrpcHostNode hostNode, TransportService.TransportServiceClient client, IGrpcNode node) { _hostConfiguration = hostConfiguration; _hostNode = hostNode; _client = client; _node = node; _runTask = Task.Run(() => RunAsync()); }
public static Node Initialize(this Node node, IGrpcHostNode hostNode) { node.Address = hostNode.NodeAddress.ToString(); node.Version = "1.0-alpha"; node.SessionId = hostNode.SessionId.ToString("D"); node.Host.Add(nameof(HostMetadataCache.Host.Assembly), HostMetadataCache.Host.Assembly); node.Host.Add(nameof(HostMetadataCache.Host.AssemblyVersion), HostMetadataCache.Host.AssemblyVersion); node.Host.Add(nameof(HostMetadataCache.Host.FrameworkVersion), HostMetadataCache.Host.FrameworkVersion); node.Host.Add(nameof(HostMetadataCache.Host.MachineName), HostMetadataCache.Host.MachineName); node.Host.Add(nameof(HostMetadataCache.Host.ProcessId), HostMetadataCache.Host.ProcessId.ToString()); node.Host.Add(nameof(HostMetadataCache.Host.ProcessName), HostMetadataCache.Host.ProcessName); node.Host.Add(nameof(HostMetadataCache.Host.MassTransitVersion), HostMetadataCache.Host.MassTransitVersion); node.Host.Add(nameof(HostMetadataCache.Host.OperatingSystemVersion), HostMetadataCache.Host.OperatingSystemVersion); node.Topology.AddRange(hostNode.GetTopology()); return(node); }
public NodeMessageFabricObserver(INodeCollection nodes, IGrpcHostNode hostNode) { _nodes = nodes; _hostNode = hostNode; }