Ejemplo n.º 1
0
        public static void ParseHeader(Metadata header, out string sender, out DistributedInvocationId senderInvocationId, out string traceId, out string token)
        {
            sender = string.Empty;
            string relatedActivityId = string.Empty;
            string environment       = string.Empty;

            traceId = string.Empty;
            token   = string.Empty;

            foreach (var kvp in header)
            {
                if (kvp.Key == GrpcMetadata.TraceIdKey)
                {
                    traceId = new Guid(kvp.ValueBytes).ToString();
                }
                else if (kvp.Key == GrpcMetadata.RelatedActivityIdKey)
                {
                    relatedActivityId = kvp.Value;
                }
                else if (kvp.Key == GrpcMetadata.EnvironmentKey)
                {
                    environment = kvp.Value;
                }
                else if (kvp.Key == GrpcMetadata.SenderKey)
                {
                    sender = kvp.Value;
                }
                else if (kvp.Key == GrpcMetadata.AuthKey)
                {
                    token = kvp.Value;
                }
            }

            senderInvocationId = new DistributedInvocationId(relatedActivityId, environment);
        }
Ejemplo n.º 2
0
 public GrpcWorkerClient(LoggingContext loggingContext, DistributedInvocationId invocationId, string ipAddress, int port, EventHandler <ConnectionFailureEventArgs> onConnectionFailureAsync)
 {
     m_loggingContext    = loggingContext;
     m_connectionManager = new ClientConnectionManager(loggingContext, ipAddress, port, invocationId);
     m_connectionManager.OnConnectionFailureAsync += onConnectionFailureAsync;
     m_client = new Worker.WorkerClient(m_connectionManager.Channel);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Class constructor
 /// </summary>
 internal GrpcServer(LoggingContext loggingContext, DistributedInvocationId invocationId)
 {
     m_loggingContext = loggingContext;
     m_invocationId   = invocationId;
 }
Ejemplo n.º 4
0
 /// <nodoc/>
 internal GrpcOrchestratorServer(LoggingContext loggingContext, IOrchestratorService orchestratorService, DistributedInvocationId invocationId)
     : base(loggingContext, invocationId)
 {
     m_grpcOrchestrator = new GrpcOrchestrator(orchestratorService);
 }
Ejemplo n.º 5
0
 public RemoteWorkerHarness(LoggingContext loggingContext, DistributedInvocationId invocationId) : base(loggingContext, invocationId)
 {
 }
Ejemplo n.º 6
0
 public DistributedActorHarness(LoggingContext loggingContext, DistributedInvocationId invocationId)
 {
     LoggingContext = loggingContext;
     InvocationId   = invocationId;
 }
Ejemplo n.º 7
0
 public OrchestratorHarness(LoggingContext context, DistributedInvocationId invocationId, int workerCount = 1) : base(context, invocationId)
 {
     RemoteWorkers = new RemoteWorkerHarness[workerCount];
 }
Ejemplo n.º 8
0
 public WorkerHarness(LoggingContext loggingContext, DistributedInvocationId invocationId, TimeSpan?callDelay = null) : base(loggingContext, invocationId)
 {
     m_callDelay = callDelay;
 }
Ejemplo n.º 9
0
 /// <nodoc/>
 internal GrpcWorkerServer(LoggingContext loggingContext, IWorkerService workerService, DistributedInvocationId invocationId)
     : base(loggingContext, invocationId)
 {
     m_grpcWorker = new GrpcWorker(workerService);
 }
Ejemplo n.º 10
0
 public GrpcOrchestratorClient(LoggingContext loggingContext, DistributedInvocationId invocationId)
 {
     m_invocationId   = invocationId;
     m_loggingContext = loggingContext;
 }
Ejemplo n.º 11
0
 public DistributionServiceMock(DistributedInvocationId invocationId) : base(invocationId)
 {
 }