mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-01 08:48:46 +02:00
01dbfee4c0
Tweetypie is the core Tweet service that handles the reading and writing of Tweet data.
35 lines
845 B
Scala
35 lines
845 B
Scala
package com.twitter.tweetypie
|
|
package store
|
|
|
|
object Flush extends TweetStore.SyncModule {
|
|
|
|
case class Event(
|
|
tweetIds: Seq[TweetId],
|
|
flushTweets: Boolean = true,
|
|
flushCounts: Boolean = true,
|
|
logExisting: Boolean = true)
|
|
extends SyncTweetStoreEvent("flush")
|
|
|
|
trait Store {
|
|
val flush: FutureEffect[Event]
|
|
}
|
|
|
|
trait StoreWrapper extends Store { self: TweetStoreWrapper[Store] =>
|
|
override val flush: FutureEffect[Event] = wrap(underlying.flush)
|
|
}
|
|
|
|
object Store {
|
|
def apply(
|
|
cachingTweetStore: CachingTweetStore,
|
|
tweetCountsUpdatingStore: TweetCountsCacheUpdatingStore
|
|
): Store =
|
|
new Store {
|
|
override val flush: FutureEffect[Event] =
|
|
FutureEffect.inParallel(
|
|
cachingTweetStore.flush,
|
|
tweetCountsUpdatingStore.flush
|
|
)
|
|
}
|
|
}
|
|
}
|