Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a thread-safe InMemorySink #21

Open
gulimran opened this issue Jun 23, 2021 · 2 comments
Open

Create a thread-safe InMemorySink #21

gulimran opened this issue Jun 23, 2021 · 2 comments

Comments

@gulimran
Copy link

We would like to create a thread-safe InMemorySink for the use in our projects. At the moment, when we make a few parallel async calls, the logger does not have all the log events.

We see two possible solutions:

  1. Add a lock object to make all methods thread-safe in the existing InMemorySink class.
  2. Same as above but in a new thread-safe class which can be accessed by a new builder method in the InMemorySinkExtensions class.

Please let me know which one is a preferred option and we are happy to raise a pull request.

@sandermvanvliet
Copy link
Contributor

@gulimran let me have a think about this.
It’s been something that’s been on my todo list for a while but I’d like to make sure the usage is going to be predictable for people using the package

@sandermvanvliet
Copy link
Contributor

I’ll check locally becauseIIRC I had a branch that already had some parts of this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants