Thanks for posting this. I'm new to .net core. While looking over the code - I'm curious. How are hosted services such as the one in your example code triggered or called? For example - if I had a separate process that needs to process some data by sending it a similar hosted service, would I need to send it via a message queue or maybe expose an http endpoint within this hosted service that gets called from the separate process (i.e web app?)
If you want to do IPC between two console apps like this one, then yes, something along those lines. However, if you're thinking about exposing an endpoint over HTTP(S) then you can create directly a Web API project - which runs in a Web Host (as opposed to a generic host) and provides the entire infrastructure for request processing.