Skip to content

Commit

Permalink
Allow the ScheduledExecutorService to be provided by the container (#178
Browse files Browse the repository at this point in the history
)

Signed-off-by: Tom Evans <[email protected]>
Co-authored-by: Emily Jiang <[email protected]>
  • Loading branch information
tevans78 and Emily-Jiang authored Jun 20, 2024
1 parent 249bc47 commit faa3daf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ release.conf
.~lock.*.odg#
**.DS_Store
.vscode

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2018, 2023 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand Down Expand Up @@ -86,14 +86,30 @@ public void shutdownEngine() {
if (engine != null) {
shutdownEngine(engine);
}
if (executorService != null) {
shutdownExecutorService(executorService);
}
}

/**
* Override this to provide a different ScheduledExecutorService
*/
protected ScheduledExecutorService createExecutorService() {
return Executors.newScheduledThreadPool(4);
}

/**
* Override this to customize the shutdown of a ScheduledExecutorService
*/
protected void shutdownExecutorService(ScheduledExecutorService executorService) {
executorService.shutdown();
}

@Factory
public Object[] allTests() {
engine = createEngine();
rs = createFactory();
executorService = Executors.newScheduledThreadPool(4);
executorService = createExecutorService();

ReactiveStreamsApiVerification apiVerification = new ReactiveStreamsApiVerification(rs);
ReactiveStreamsSpiVerification spiVerification =
Expand Down

0 comments on commit faa3daf

Please sign in to comment.