Closed ioreskovic closed 2 years ago
Hi @ioreskovic,
We currently don't have implemented the write API in Scala. We want to have a Akka-friendly Write API and I hope so that we will have an enough time to implemented soon.
Could you describe your requirements? It will help us to implement what users want.
Regards
Thank you for your response @bednar!
Well, looking at other use cases within alpakka connectors, I would like to see something along these lines:
A plain sink, which may or may not do under the hood batching:
Sink[Point[T], Future[WriteResult]]
where WriteResult
would be an indicator of an operation, perhaps Done
is a good starting candidate if no other information is to be transmitted
An explicit batched sink:
Sink[Seq[Point[T]], Future[WriteResult]]
A simple flow:
Flow[Point[T], WriteResult, Mat]
where this WriteResult
could be different from the one in sink, here perhaps carrying more information, such as input + response
Batched flow
Flow[Seq[Point[T]], WriteResult, Mat]
with "atomicity" guarantees with a batch, meaning if the input (Seq[Point[T]]
) has passed through the flow, then all the elements have been written (or submitted to writing, depending on which delivery guarantees are used)
Flow with context
FlowWithContext[Point[T], C, WriteResult, C, Mat]
Batched flow with context
FlowWithContext[Seq[Point[T]], C, WriteResults, C, Mat]
Edit:
Looking at alpakka-kafka, a unifying type such as Envelope a = Single a | Multi [a] | PassThrough
(and their corresponding responses) might be more ergonomic, and then simple and batched flow(withContext) and could be replaced with a "flexiFlow(withContext)": Flow[Envelope[T, PT], Results[T, PT], Mat]
@ioreskovic thanks for detail info. It is huge inspiration for us! Thanks again.
might consider changing the README to take out that write is supported?
"The reference Scala client that allows query and write for the InfluxDB 2.0 by Akka Streams."
Write API for Scala seems to be missing. Is that a deliberate choice or an oversight?
I case of former, is it still in development, and if so, what is the Akka-friendly alternative?