Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the ScheduledExecutorService to be provided by the container #178

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ release.conf
/bin/
.~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