-
Notifications
You must be signed in to change notification settings - Fork 249
Code Tips
Chris Lu edited this page Oct 24, 2015
·
3 revisions
Many other systems favors a database-oriented row/column approach when dealing with data. However, it loosens the type information.
It's totally fine to use the struct.
type Product struct{
Id int
Name string
}
type Rating struct{
ProductId int
Score int
}
productChan := make(chan Product)
ratingChan := make(chan Rating)
f := flow.New()
prod := f.Channel(productChan).Map(func (p Product) (int, Product){
return p.Id, p
})
rating := f.Channel(ratingChan).Map(func (r Rating) (int, Rating){
return r.ProductId, r
})
prod.Join(rating)....