feat: Waku v2 bridge

Issue #12610
This commit is contained in:
Michal Iskierko
2023-11-12 13:29:38 +01:00
parent 56e7bd01ca
commit 6d31343205
6716 changed files with 1982502 additions and 5891 deletions

26
vendor/github.com/anacrolix/chansync/semaphore.go generated vendored Normal file
View File

@@ -0,0 +1,26 @@
package chansync
import (
"github.com/anacrolix/chansync/events"
)
// Channel semaphore, as is popular for controlling access to limited resources. Should not be used
// zero-initialized.
type Semaphore struct {
ch chan struct{}
}
// Returns an initialized semaphore with n slots.
func NewSemaphore(n int) Semaphore {
return Semaphore{ch: make(chan struct{}, n)}
}
// Returns a channel for acquiring a slot.
func (me Semaphore) Acquire() events.Acquire {
return me.ch
}
// Returns a channel for releasing a slot.
func (me Semaphore) Release() events.Release {
return me.ch
}