(name string)
| 42 | } |
| 43 | |
| 44 | func (f *MemoryQueueFactory) getOrCreateChan(name string) chan Record { |
| 45 | f.mu.Lock() |
| 46 | defer f.mu.Unlock() |
| 47 | defer func() { |
| 48 | slog.InfoContext(f.ctx, "Get memory queue chan", |
| 49 | "current_use_count", atomic.LoadInt32(&f.queues[name].refCnt), |
| 50 | "name", name) |
| 51 | }() |
| 52 | if q, ok := f.queues[name]; ok { |
| 53 | atomic.AddInt32(&q.refCnt, 1) |
| 54 | return q.c |
| 55 | } |
| 56 | c := make(chan Record, 100) |
| 57 | f.queues[name] = &queue{ |
| 58 | c: c, |
| 59 | refCnt: 1, |
| 60 | } |
| 61 | return c |
| 62 | } |
| 63 | |
| 64 | func (f *MemoryQueueFactory) release(name string) { |
| 65 | f.mu.Lock() |
no outgoing calls
no test coverage detected