mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-30 12:01:15 +02:00
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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user