
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Note: Figuring out wait groups in some cases is a bit finicky currently. The group that lq.Wait() waits on is exposed publicly for this reason at the moment, in case you need to add anything to it.
NewListQueue returns a queue which ensures in order delivery of every past and future event to every subscriber.
q := lq.NewListQueue[int]()
q.Add(1, 2)
q.Each() will return a channel which iterates over past and future arguments added with q.Add(...)
go func() {
for v := range q.Each() {
// Prints: 1
// 2
fmt.Println(v)
q.Done()
}
}()
q.Add(3, 4)
q.Close()
for v := range q.Each() {
// Prints: 1
// 2
// 3
// 4
fmt.Println(v)
q.Done()
}
import "github.com/RyanJarv/ListQueue"
const ChanSize = 10
type IListQueue[T any] interface {
Add(...T)
Each() chan T
Close()
Wait()
}
type IWaitGroup interface {
Add(i int)
Done()
Wait()
}
type ListQueue[T any] struct {
// Has unexported fields.
}
NewListQueue returns a queue which ensures exactly once, in order delivery of every past and future event to every subscriber.
q := listQueue.NewListQueue[int]()
q.Add(1, 2)
ch := q.Each()
q.Each() will return a channel which can be used to iterate over past and future arguments added with Add(...). For each item returned from this channel. The queue needs to be closed after all items have been added with Add(...) for loops using q.Each() to exit.
go func() {
for v := range ch {
// Prints: 1
// 2
fmt.Println(v)
q.Done()
}
Loops created after Close() is called will still work as expected, but new values can't be added with Add(...).
q.Add(3, 4)
q.Close()
for v := range q.Each() {
// Prints: 1
// 2
// 3
// 4
fmt.Println(v)
q.Done()
}
}()
Add adds all passed arguments to the list and wakes up any paused goroutines to continue reading from the list.
Each returns a channel which will be sent all current and future items passed to Add in the order they were added.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.