mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-21 04:57:18 +02:00
pkg/storage: introduce storage.Backend Watch method (#1135)
Currently, we're doing "sync" in databroker server. If we're going to support multiple databroker servers instance, this mechanism won't work. This commit moves the "sync" to storage backend, by adding new Watch method. The Watch method will return a channel for the caller. Everytime something happens inside the storage, we notify the caller by sending a message to this channel.
This commit is contained in:
parent
d9711c8055
commit
a7bd2caae9
10 changed files with 204 additions and 44 deletions
|
@ -29,4 +29,9 @@ type Backend interface {
|
|||
|
||||
// ClearDeleted is used clear marked delete records.
|
||||
ClearDeleted(ctx context.Context, cutoff time.Time)
|
||||
|
||||
// Watch returns a channel to the caller. The channel is used to notify
|
||||
// about changes that happen in storage. When ctx is finished, Watch will close
|
||||
// the channel.
|
||||
Watch(ctx context.Context) chan struct{}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue