making progress, almost ready to write to disk
This commit is contained in:
34
ingester/ingester.go
Normal file
34
ingester/ingester.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package ingester
|
||||
|
||||
import "time"
|
||||
import "github.com/rs/zerolog/log"
|
||||
import "github.com/sneak/feta/toot"
|
||||
import "github.com/sneak/feta/storage"
|
||||
|
||||
type TootIngester struct {
|
||||
inbound chan *toot.Toot
|
||||
recentlySeen []*seenTootMemo
|
||||
storageBackend *storage.TootStorageBackend
|
||||
}
|
||||
|
||||
type seenTootMemo struct {
|
||||
lastSeen time.Time
|
||||
tootHash toot.TootHash
|
||||
}
|
||||
|
||||
func NewTootIngester() *TootIngester {
|
||||
ti := new(TootIngester)
|
||||
ti.inbound = make(chan *toot.Toot, 1)
|
||||
return ti
|
||||
}
|
||||
|
||||
func (ti *TootIngester) GetDeliveryChannel() chan *toot.Toot {
|
||||
return ti.inbound
|
||||
}
|
||||
|
||||
func (ti *TootIngester) Ingest() {
|
||||
log.Info().Msg("TootIngester starting")
|
||||
for {
|
||||
time.Sleep(1 * time.Second) // FIXME do something
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user