Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Closes #349 DelegatingScheduler: Bill Pugh Singleton Implementation#350

Open
magicprinc wants to merge 6 commits intofailsafe-lib:masterfrom
magicprinc:feature
Open

Closes #349 DelegatingScheduler: Bill Pugh Singleton Implementation#350
magicprinc wants to merge 6 commits intofailsafe-lib:masterfrom
magicprinc:feature

Conversation

Copy link

magicprinc commented Nov 26, 2022 *
edited
Loading

Closes #349

magicprinc changed the title #349 DelegatingScheduler: Bill Pugh Singleton Implementation Closes #349 DelegatingScheduler: Bill Pugh Singleton Implementation Nov 26, 2022
Copy link
Author

magicprinc commented Nov 26, 2022

Second commit contains:

  1. bug fix in DelegatingScheduler#schedule: (delay == 0) - (delay <= 0)

  2. fix, if user's executor is actually commonPool() without parallelism. Similar to CompletableFuture.screenExecutor

  3. Use less memory: don't capture variable if executor is commonPool (Lambda can access it without capturing through static field.

magicprinc added 4 commits November 27, 2022 17:00
pre-calculate everything
use less memory
compact lambdas
ScheduledCompletableFuture doesn't have to keep `time`: it can simply call delegate
ThreadFactory.newThread: setName can be done in ctor
if - ? :
jhalterman force-pushed the master branch from c92b594 to be89177 Compare January 31, 2023 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

DelegatingScheduler singletons in modern style

1 participant