protected virtual void Init() { var fabric = new ManualFabricBridge(); var bridgeOut = fabric[FabricMode.Queue]; var bridgein = fabric[FabricMode.Broadcast]; mWebApi = new UnityWebApiMicroservicePipeline("Web") .CallOut(WebApiConfigure) .AddChannelOutgoing("Request", "This is the outgoing request channel") .AttachSender(mBridgeRequest.GetSender()) .Revert() .AddChannelIncoming("Response", "This is the response channel back from the Service") .AttachListener(mBridgeResponse.GetListener()) .Revert(); mService1 = new MicroservicePipeline("Service") .CallOut(ServiceConfigure) .AddChannelIncoming("Request", "This is the incoming request channel from the API") .AttachListener(mBridgeRequest.GetListener()) .Revert() .AddChannelOutgoing("Response", "This is the outgoing request channel") .AttachSender(mBridgeResponse.GetSender()) .Revert() ; mService1.Start(); mWebApi.Start(); }
public void Create(string id , ICommunicationBridge bridgeOut, ICommunicationBridge bridgeIn, ICommunicationBridge bridgeMaster , TestMasterJobCommand masterjob , out PersistenceClient <Guid, BridgeMe> init, out DebugMemoryDataCollector memcollector) { var pipeline = new MicroservicePipeline(id) .AdjustPolicyTaskManagerForDebug() .AdjustPolicyCommunication((p, c) => p.BoundaryLoggingActiveDefault = true) .AddDebugMemoryDataCollector(out memcollector) .AddChannelIncoming("local", internalOnly: true) .AttachCommand(masterjob) .Revert() .AddChannelIncoming("cresponse") .AttachListener(bridgeIn.GetListener()) .Revert() .AddChannelOutgoing("crequest") .AttachSender(bridgeOut.GetSender()) .AttachPersistenceClient("cresponse", out init) .Revert() .AddChannelBroadcast("negotiate") .AttachListener(bridgeMaster.GetListener()) .AttachSender(bridgeMaster.GetSender()) .AssignMasterJob(masterjob) .Revert() ; Add(id, pipeline, masterjob); }
protected virtual void Init() { var fabric = new ManualFabricBridge(); mBridgeRequest = new ManualCommunicationBridgeAgent(fabric, CommunicationBridgeMode.RoundRobin); mBridgeResponse = new ManualCommunicationBridgeAgent(fabric, CommunicationBridgeMode.Broadcast); mWebApi = new UnityWebApiMicroservicePipeline("Web") .CallOut(WebApiConfigure) .AddChannelOutgoing("Request", "This is the outgoing request channel") .AttachSender(mBridgeRequest.GetSender()) .Revert() .AddChannelIncoming("Response", "This is the response channel back from the Service") .AttachListener(mBridgeResponse.GetListener()) .Revert(); mService1 = new MicroservicePipeline("Service") .CallOut(ServiceConfigure) .AddChannelIncoming("Request", "This is the incoming request channel from the API") .AttachListener(mBridgeRequest.GetListener()) .Revert() .AddChannelOutgoing("Response", "This is the outgoing request channel") .AttachSender(mBridgeResponse.GetSender()) .Revert() ; mService1.Start(); mWebApi.Start(); }