Closed richardmillen closed 7 years ago
I ran this with 10 subscribers, left it for 20 minutes and came back to find 1 subscriber had shut itself down with the following output:
$ ./pathosub localhost:5558
pathosub (72516): connecting to 'tcp://localhost:5558'...
pathosub (72516): subscribing to topic '15'...
pathosub (72516): Save Roger!
pathosub: bug: '159' is not equal to '15'.
I'll re-test but without the lvcache
running.
No need to wait this time. I got this within 10 seconds of running the first subscriber:
$ ./pathosub localhost:5556
pathosub (68084): connecting to 'tcp://localhost:5556'...
pathosub (68084): subscribing to topic '11'...
pathosub: bug: '115' is not equal to '11'.
This was subscribing directly to the publisher i.e. without the lvcache
in the middle.
It's interesting to see that in both instances the incorrect value received starts with the correct value...
i.e.
15
9 instead of 15
& 11
5 instead of 11
.
I believe this is simply a design flaw in the example itself.
It would be simple to fix - just make sure the pub/sub topic is limited to 3 digits i.e. 100-999.
Implement the Last Value Caching example.