More RPC-related logs (#136)

* More RPC-related logs

* Notifier should be set before we use it in the scheduler
This commit is contained in:
Nikolay Edigaryev
2023-09-27 20:16:00 +04:00
committed by GitHub
parent 64987f6d59
commit 40f58e4aee
5 changed files with 20 additions and 8 deletions
+5 -5
View File
@@ -5,17 +5,17 @@ import (
)
type ConcurrentMap[T any] struct {
nonConcurrentMap map[any]T
nonConcurrentMap map[string]T
mtx sync.Mutex
}
func NewConcurrentMap[T any]() *ConcurrentMap[T] {
return &ConcurrentMap[T]{
nonConcurrentMap: map[any]T{},
nonConcurrentMap: map[string]T{},
}
}
func (cmap *ConcurrentMap[T]) Load(key any) (T, bool) {
func (cmap *ConcurrentMap[T]) Load(key string) (T, bool) {
cmap.mtx.Lock()
defer cmap.mtx.Unlock()
@@ -24,14 +24,14 @@ func (cmap *ConcurrentMap[T]) Load(key any) (T, bool) {
return result, ok
}
func (cmap *ConcurrentMap[T]) Store(id any, value T) {
func (cmap *ConcurrentMap[T]) Store(id string, value T) {
cmap.mtx.Lock()
defer cmap.mtx.Unlock()
cmap.nonConcurrentMap[id] = value
}
func (cmap *ConcurrentMap[T]) Delete(key any) {
func (cmap *ConcurrentMap[T]) Delete(key string) {
cmap.mtx.Lock()
defer cmap.mtx.Unlock()