File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
impl/core/src/main/java/io/serverlessworkflow/impl/executors Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 3838import io .serverlessworkflow .impl .resources .ResourceLoader ;
3939import java .net .URI ;
4040import java .time .OffsetDateTime ;
41- import java .util .ArrayList ;
4241import java .util .Collection ;
4342import java .util .Map ;
4443import java .util .Optional ;
@@ -80,12 +79,10 @@ protected CompletableFuture<WorkflowModel> internalExecute(
8079 Collection <EventPublisher > eventPublishers =
8180 workflow .definition ().application ().eventPublishers ();
8281 CloudEvent ce = buildCloudEvent (workflow , taskContext );
83- Collection <CompletableFuture <Void >> allCompletables = new ArrayList <>();
84- for (EventPublisher eventPublisher : eventPublishers ) {
85- allCompletables .add (eventPublisher .publish (ce ));
86- }
8782 return CompletableFuture .allOf (
88- allCompletables .toArray (new CompletableFuture [allCompletables .size ()]))
83+ eventPublishers .stream ()
84+ .map (eventPublisher -> eventPublisher .publish (ce ))
85+ .toArray (size -> new CompletableFuture [size ]))
8986 .thenApply (v -> taskContext .input ());
9087 }
9188
You can’t perform that action at this time.
0 commit comments