reugn / go-streams

A lightweight stream processing library for Go

Home Page:https://pkg.go.dev/github.com/reugn/go-streams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Panic happened when I use NewSlidingWindowWithTSExtractor

transfercai opened this issue · comments

I want to make my own timestamp func by using NewSlidingWindowWithTSExtractor, here is my code:
var elemTSExtractor = func(elem interface{}) int64 { fmt.Println("<------------------->") fmt.Println(elem) return time.Now().UnixNano() } k.slidingWindow = flow.NewSlidingWindowWithTSExtractor(time.Second*30, time.Second*5, elemTSExtractor)
bug got a panic. how can i use my own timestamp in sliding window.