instream
instream copied to clipboard
Write operation could return the created object
From what I've tested, the write function returns :ok in case of success.
It would be interesting if it returned a tuple {:ok, object} containing the object that has been created during this operation.
The decision behind only returning :ok or :error was a quite simple one: I don't know what to really return otherwise.
It should be possible to return the object that has been passed in back when writing. Without any modifications that is as things like timestamps could be defined by the InfluxDB instance itself and having asynchronous UDP writing there is now way to get that.
Might be interesting to know whether write patterns are more of the "fire and forget" nature or if piping the result is a worthy addition. I think this one might be more easier to answer after looking at how some other data writing libraries behave.
Maybe only return the object when it's not UDP? I see UDP more of a "fire and forget".