mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 11:58:02 +00:00
e3f9e9c05e
* use global id generator * remove duplicate `UserRemoved` Co-authored-by: Livio Amstutz <livio.a@gmail.com>
29 lines
665 B
Go
29 lines
665 B
Go
package spooler
|
|
|
|
import (
|
|
"github.com/caos/logging"
|
|
"github.com/caos/zitadel/internal/eventstore"
|
|
"github.com/caos/zitadel/internal/id"
|
|
)
|
|
|
|
type Config struct {
|
|
Eventstore eventstore.Eventstore
|
|
Locker Locker
|
|
ViewHandlers []Handler
|
|
ConcurrentTasks int
|
|
}
|
|
|
|
func (c *Config) New() *Spooler {
|
|
lockID, err := id.SonyFlakeGenerator.Next()
|
|
logging.Log("SPOOL-bdO56").OnError(err).Panic("unable to generate lockID")
|
|
|
|
return &Spooler{
|
|
handlers: c.ViewHandlers,
|
|
lockID: lockID,
|
|
eventstore: c.Eventstore,
|
|
locker: c.Locker,
|
|
queue: make(chan *spooledHandler),
|
|
concurrentTasks: c.ConcurrentTasks,
|
|
}
|
|
}
|