You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Ilya Kozyrev (Jira)" <ji...@apache.org> on 2021/12/01 10:22:00 UTC
[jira] [Created] (BEAM-13360) [Playground] Fix synchronous validators
Ilya Kozyrev created BEAM-13360:
-----------------------------------
Summary: [Playground] Fix synchronous validators
Key: BEAM-13360
URL: https://issues.apache.org/jira/browse/BEAM-13360
Project: Beam
Issue Type: Bug
Components: beam-playground
Reporter: Ilya Kozyrev
For validators, we start a single goroutine for validateFunc in which we loop through all validators synchronously.
{code:java}
go validateFunc(successChannel, errorChannel, valResChannel)
// Validate returns the function that applies all validators of executor
func (ex *Executor) Validate() func(chan bool, chan error) {
return func(doneCh chan bool, errCh chan error) {
for _, validator := range ex.validators {
err := validator.Validator(validator.Args...)
if err != nil {
errCh <- err
doneCh <- false
return
}
}
doneCh <- true
}
}
{code}
Instead of that, we should start goroutines for each loop step. And control results for each validator with separate channels.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)