-
Notifications
You must be signed in to change notification settings - Fork 126
(Re)Implement QueryJSON
as LogMsg
emitter
#531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pre-release
Are you sure you want to change the base?
Conversation
QueryJSON
as LogMsg
emitter
@rainkwan and I just tested these changes along with the new tfjson changes in |
@SBGoods I am aware and working through resolving that. |
b3bfedb
to
ca4fa35
Compare
ca4fa35
to
9a8d530
Compare
061a850
to
54411be
Compare
173d41e
to
4ec9059
Compare
4ec9059
to
ff3f3e6
Compare
ff3f3e6
to
c05687b
Compare
// TODO: handle error | ||
_ = pr.Close() | ||
// TODO: handle error | ||
_ = pw.Close() | ||
// TODO: handle error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBD: We could surface these somehow through additional methods or fields on LogMsgEmitter
though that makes them time/ordering dependent. Perhaps it's obvious that you can't possibly have such errors until you have finished reading the last message but perhaps it's not.
Also we should probably work out what these errors could possibly be and what is the likelihood of them occurring all at the same time - i.e. whether we really need 3 separate fields/methods for those or whether we can just have 1.
// Stdout reader is closed when the last message is received. | ||
// | ||
// Error returned can be related to decoding of the message (nil, true, error) | ||
// or closing of stdout reader (nil, false, error). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of the comment is actually no longer true as it relates to earlier version of the code.
I'm still unsure where exactly it is best to close the stdout reader and how/whether to surface the error from that.
Alternative Solutions
I have also considered implementing this via
iter.Seq
which would make for a simpler interface that caller can justrange
over but that would probably imply ignoring any and all errors associated with reading and parsing individual messages, which does not seem like an ideal design.TODO