mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
32 lines
748 B
Go
32 lines
748 B
Go
// Copyright 2022 Molecula Corp. (DBA FeatureBase).
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
package gcnotify
|
|
|
|
import (
|
|
"github.com/CAFxX/gcnotifier"
|
|
pilosa "github.com/featurebasedb/featurebase/v3"
|
|
)
|
|
|
|
// Ensure ActiveGCNotifier implements interface.
|
|
var _ pilosa.GCNotifier = &activeGCNotifier{}
|
|
|
|
type activeGCNotifier struct {
|
|
gcn *gcnotifier.GCNotifier
|
|
}
|
|
|
|
// NewActiveGCNotifier creates an active GCNotifier.
|
|
func NewActiveGCNotifier() *activeGCNotifier {
|
|
return &activeGCNotifier{
|
|
gcn: gcnotifier.New(),
|
|
}
|
|
}
|
|
|
|
// Close implements the GCNotifier interface.
|
|
func (n *activeGCNotifier) Close() {
|
|
n.gcn.Close()
|
|
}
|
|
|
|
// AfterGC implements the GCNotifier interface.
|
|
func (n *activeGCNotifier) AfterGC() <-chan struct{} {
|
|
return n.gcn.AfterGC()
|
|
}
|