I’d like to ask for a recommendatation as I haven’t had such a task yet.
I stream data from a server, log them to a file as well as do some calculation on the fly (both written in golang). The problem is that whenever there’s a bug in the calculations, the program panics and the streaming/logging is stopped as well. How would I efficiently separeate streaming and calculation apps in a way that calculation app is using the streamed data? One solution coming to my mind is with tail command in Linux, but this is already using some external solution, probably with much overhead. Any suggestions very much appreciated
Write a channel pipeline. In the goroutine that does the calculation, defer a panic recovery. If a panic occurs, log the error and continue reading from the channel so that the streaming can continue.
Thanks for a suggestion, will look into it and I think will be able to implement it. If, perhaps, there’s a simple example, would be appreciated… thanks!!