itkpi / trembita

Model complex data transformation pipelines easily
Apache License 2.0
46 stars 3 forks source link

Cons Environment #34

Open vitaliihonta opened 5 years ago

vitaliihonta commented 5 years ago

Allow programmer to write same code for different possible environments. For instance:

val pipeline: DataPipelineT[F, A, Sequential] = ???
val pipeline2: DataPipelineT[F, A, Akka[NotUsed] Or Spark]
  .to[Akka[NotUsed]]
  .orTo[Spark](condition = ???)
  . // some possible heavy operations

This should allow more flexible applicaitons which can be run on different environments depending on some condition (for isntance amount of your data). Additionaly such implicit derivation should work:

def func[E <: Environment](implicit ev: E Supports CanGroupBy) = ???
func[Akka[NotUsed] Or Spark]

And this shouldn't

def func2[E <: Environment](implicit ev: E Supports CanSort) = ???
func[Akka[NotUsed] Or Spark] // doesn't compile