Singleton improvement
As a following of the singleton usage #42 (closed), !85 (merged), !86 (closed), I discover, that it’s not working perfectly. And that, inside the singleton, it was called many time. So, the singleton wasn’t doing was it was made for.
Trying to find the issue, I discovered singleton_decorator which works fine for the singleton feature.
Let’s move to this solution.
In the end no, because this package won’t be integrated in Distributions such as Debian. So we are going to define a singelton locally from the StackOverFlow link bellow.
In the end, I found that we have some issues using asynchronism and singleton.
It feels like async and singleton are not made for and that singleton is not useful with asynchronism.
We get this kind of errors:
RuntimeWarning: coroutine 'HeadBlock.get_head' was never awaited
Some reading about async singleton: