instream icon indicating copy to clipboard operation
instream copied to clipboard

Write operation could return the created object

Open guilhermearaujo opened this issue 9 years ago • 2 comments

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.

guilhermearaujo avatar Nov 05 '16 16:11 guilhermearaujo

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.

mneudert avatar Nov 10 '16 19:11 mneudert

Maybe only return the object when it's not UDP? I see UDP more of a "fire and forget".

joshuataylor avatar Aug 01 '17 20:08 joshuataylor