ReactiveXComponent.Net is a .Net client API that allows you to interact with microservices generated with XComponent software.
Use Nuget to install the latest version of the API:
nuget install ReactiveXComponent.Net -Pre
Usage example of ReactiveXComponent.Net API
// All the info we need is in the xcApi file. Get a XComponentApi..IXComponentApixcApi=XComponentApi.CreateFromXCApi(@".\HelloWorld.xcApi");// Create a session..using(IXCSessionxcSession=xcApi.CreateSession()){varcomponentName="HelloWorld";varhelloWorldManagerStateMachineName="HelloWorldManager";varhelloWorldResponseStateMachineCode=1837059171;// Create a subscriber..varsubscriber=xcSession.CreateSubscriber(componentName);// Create a publisher..varpublisher=xcSession.CreatePublisher(componentName);// Need to call subscribe for the state machine we are interested in..subscriber.Subscribe(helloWorldManagerStateMachineName, arg =>{});// Subscribe to state machine updates via the IObservable collection..vareventReceived=newManualResetEvent(false);varobserver=Observer.Create<MessageEventArgs>(args =>{Console.WriteLine(args.MessageReceived);eventReceived.Set();});varsubscription=subscriber.StateMachineUpdatesStream.Where(e =>e.StateMachineRefHeader.StateMachineCode==helloWorldResponseStateMachineCode).Subscribe(observer);// Send an event to a state machine..varsayHiEvent=newSayHi(){To="World"};publisher.SendEvent(helloWorldManagerStateMachineName,sayHiEvent);// Wait for state machine update and dispose subscription..eventReceived.WaitOne(5000);subscription.Dispose();}Download the source code and execute the following command in a PowerShell:
.\build.ps1 -Target All
That would build the source code run the tests and create a Nuget package under the nuget folder.
The complete command that contains all the possible parameters is as follows:
.\build.ps1 -Target <Target> --buildConfiguration=<build_config> --buildVersion=<build_version> --setAssemblyVersion=<true_or_false>
target can be one of these values:
Clean
RestoreNugetPackages
Build
Test
CreatePackage
All
Default value: Build
buildConfiguration can be either Debug or Release.
Default value: Release
buildVersion is the build version to set for the assembly or Nuget package.
Default value: 1.0.0-build1
setAssemblyVersion can be either True or False. When set to true the assembly version will be set to the value indicated by buildVersion.
Default value: False
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push -u origin my-new-feature - Submit a pull request
Apache License V2
