File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/main/scala/com/intenthq/action_processor/integrations/feeds Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com .intenthq .action_processor .integrations .feeds
2
2
3
+ import java .time .{Clock , LocalDate }
4
+
3
5
import cats .effect .IO
4
6
5
7
trait Feed [I , O ] {
6
8
9
+ lazy val feedName : String = getClass.getSimpleName.stripSuffix(" $" )
10
+ def date (feedContext : FeedContext [IO ], clock : Clock = Clock .systemDefaultZone()): IO [LocalDate ] =
11
+ feedContext.filter.date.fold(IO .delay(java.time.LocalDate .now(clock)))(IO .pure)
12
+ def part (feedContext : FeedContext [IO ]): Int = feedContext.filter.time.fold(0 )(_.getHour)
13
+
7
14
def inputStream (feedContext : FeedContext [IO ]): fs2.Stream [IO , I ]
8
15
def transform (feedContext : FeedContext [IO ]): fs2.Pipe [IO , I , (O , Long )]
9
16
def serialize (o : O , counter : Long ): Array [Byte ]
You can’t perform that action at this time.
0 commit comments