trueblocks-core
trueblocks-core copied to clipboard
Add an example listener in core
~Instead of having the listener in a different repo, it should be in the scraper.~
~In this way, we could easily just add a --notify option which would kick off a Go Routine that would listen.~
~Running the scraper is hard enough. It shouldn't be made harder.~
~No. It should not be in a docker file (although, I'm open to discussion, I suppose.) I don;t mind that hte scraper is in a docker, but havign separet dokcers for scraper and listener is suboptimal.~
Having Notify inside of core is great, but it requires a listener. Currently, our only example of a listener sends its results to AWS. Because we do not want to bring this code into core, but we do want to show people how they can "wire up" a listener, we could add an example listener that does nothing but fmt.Println (sort of like --file but with options for --file including stdout or stderr.
We can do this by abstracting out the ./queue/insert code into something that can be used as an example.
@dszlachta Your thoughts?
@dszlachta How hard would it be to make an example of a listener that simply dumped the sent messages to the screen? I think it would be very easy...