You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Aydar Zaynutdinov (Jira)" <ji...@apache.org> on 2021/12/01 11:30:00 UTC
[jira] [Updated] (BEAM-13360) [Playground] Fix synchronous validators
[ https://issues.apache.org/jira/browse/BEAM-13360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aydar Zaynutdinov updated BEAM-13360:
-------------------------------------
Status: Open (was: Triage Needed)
> [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
> Assignee: Aydar Zaynutdinov
> Priority: P2
> Labels: beam-playground-backend, beam-playground-sprint-5
>
> 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)