Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Remove Delay usage from BlockProcessor #482

Open
aboimpinto opened this issue Oct 4, 2018 · 1 comment
Open

Remove Delay usage from BlockProcessor #482

aboimpinto opened this issue Oct 4, 2018 · 1 comment

Comments

@aboimpinto
Copy link
Contributor

In the name of clean and good code we should find a solution where we don't need to use the Task.Delay that drain the resources like CPU and energy.

Maybe it's possible to create a class that implement the observable pattern like the ObservableCollection but in our case a "ConcurrentObservableCollection" (something like this) where an event is fired when something is added to the list.

@aboimpinto
Copy link
Contributor Author

aboimpinto commented Oct 4, 2018

Found this threads in StackOverlow

where someone said that implement a version of the Observable Collection using ReaderWriteLockSlim
https://pastebin.com/hKQi6EHD

this is an example from the Microsoft site using too the ReaderWriteLockSlim
https://docs.microsoft.com/en-us/dotnet/api/system.threading.readerwriterlockslim?view=netframework-4.7.2

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

No branches or pull requests

1 participant