Code-Sharp/WampSharp

How to run the samples?

Dinglebarry9 opened this issue · 9 comments

Wampsharp.net reflection and rx publisher/subscriber samples do not include a Main function and I am not sure how to call Run()?

darkl commented

Run is the Main function. You can change Run to public static async Task MainAsync(string[] args). All these examples also appear (in a more sophisticated way) as csprojs of the WampSharp solution.

Thanks for the help. The csproj fails to restore for me. I got the getting started and raw pub/sub to work fine, the reflection pub/sub runs but the subscriber doesn't seem to be receiving anything? Do you have to add a line to subscribe to a certain WampTopic?

darkl commented

You need to run two different processes for the subscriber and the publisher, by default a subscriber does not receive its own publications. Another option is to register the publisher with a IPublisherRegistrationInterceptor with PublishOptions specifying ExcludeMe = false.

Yes I have 2 processes, the publisher and subscriber from the example.

darkl commented

Did you call RegisterPublisher and RegisterSubscriber?
Try adding await Task.Yield(); before the Console.ReadLine();.

darkl commented

The examples don't have a Console.ReadLine(); but just add as the last two lines of your MainAsync the lines

await Task.Yield();
Console.ReadLine();

That was it I was going by the the WampSharp.net examples. This worked thank you very much.

darkl commented

I will update them to include these lines.

darkl commented

Done.