(ctx context.Context, a *sequenceAllocator, frequency time.Duration)
| 875 | } |
| 876 | |
| 877 | func runAllocator(ctx context.Context, a *sequenceAllocator, frequency time.Duration) (allocationCount uint64) { |
| 878 | |
| 879 | allocationCount = 0 |
| 880 | ticker := time.NewTicker(frequency) |
| 881 | for { |
| 882 | select { |
| 883 | case <-ticker.C: |
| 884 | _, _ = a.nextSequence(ctx) |
| 885 | allocationCount++ |
| 886 | case <-ctx.Done(): |
| 887 | ticker.Stop() |
| 888 | log.Printf("allocator count: %v", allocationCount) |
| 889 | return allocationCount |
| 890 | } |
| 891 | } |
| 892 | } |
| 893 | |
| 894 | func getClientSequenceBatchSize(allocator *sequenceAllocator) uint64 { |
| 895 | allocator.mutex.Lock() |
no test coverage detected