yeah I too would like to know the best way to handle an event store connection, for example in a web application.
Would each request open up it’s own connection to save an event, or would there be one connection per application?
I’ve found this blog post
“It is important to note that all operations on a connection are asynchronous. This results in a different usage pattern than those who are familiar with say a SqlConnection. Because all operations are asynchronous a single connection can be used by many threads concurrently. This is also exposed through the connection interface by the returning of Tasks as opposed to synchronous behaviours.”
Is there an example/best practice of how to manage a single connection within a web application?
And would there be a difference if you cared if the event was saved or not?
E.g. fire and forget, rather than waiting for the task to complete before ending the web request?