You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I assume you're thinking of this in relation to #160 and mikeshulman/narya#24. Reading #160 I also had the thought that this is maybe a natural abstraction. So as not to change the default behavior, my thought would be to have a buffer wrapper that intercepts diagnostics from its supplied continuation and accumulates them. Then after that continuation completes, it does something with the accumulated diagnostics, as specified by the other arguments it received, such as:
packaging them into a single "bunched" diagnostic and emitting that for a handler further up the call stack to catch (which might itself be a buffering accumulator)
applying some user-specified filter to remove or modify some of them before doing the above, or perhaps nothing
In addition, for my application I think I would also want:
a function that can be called from the continuation that inspects the diagnostics accumulated so far
a callback that the buffering handler executes on each diagnostic it receives to decide whether to accumulate it, ignore it, or immediately re-emit it for a higher handler
And probably most of this behavior should be separately configurable for fatal and non-fatal diagnostics.
@mikeshulman Got it. And I am also thinking about thread-safety so that it can solve #151. Perhaps we should just have a domain-specific language for this...
This is another thing that could be helpful for many purposes.
The text was updated successfully, but these errors were encountered: