-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
bugMake it rightMake it rightp1We can live without it but it's very importantWe can live without it but it's very importantsmallHoursHours
Description
The Tap component currently sends data to its res outport even if an error occurs in its handler. This violates the "rule of thumb" in Neva where multiple output ports should define different (usually exclusive) scenarios.
Observe the implementation of Tap in core.neva:
pub def Tap<T>(data T) (res T, err error) {
pass1 Pass<T>
pass2 Pass<T>
lock Lock<T>
handler ITapHandler<T>
---
:data -> [lock:data, handler]
handler:res -> pass1
handler:err -> [pass2, :err]
[pass1, pass2] -> lock:sig
lock -> :res
}
When handler:err emits a message, it goes to both :err and pass2. pass2 then triggers lock:sig, which releases the original data to :res.
Expected Behavior: :res should only receive data if the handler succeeds (handler:res). If an error occurs (handler:err), the message should go to :err and the internal data flow should stop (by explicitly routing the message to Del).
Metadata
Metadata
Assignees
Labels
bugMake it rightMake it rightp1We can live without it but it's very importantWe can live without it but it's very importantsmallHoursHours