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

SequencedExecutor #1

Closed
Adeynack opened this issue Dec 19, 2017 · 0 comments · Fixed by #7
Closed

SequencedExecutor #1

Adeynack opened this issue Dec 19, 2017 · 0 comments · Fixed by #7
Assignees
Labels
Projects

Comments

@Adeynack
Copy link
Owner

Use cases

  • Limit the number of parallel tasks of a similar nature that are executed at the same time to 1.
  • Ensure mutually exclusive "lock" over a mutable resource without blocking
    • Done by configuring this Executor with only 1 parallel task.
    • Example: Protect a mutable state inside of a service

Why not ...

... use Executors.newSingleThreadExecutor();

Because it creates a new thread. This proposition is an Executor that limits without creating any new thread. The thread pool already exist and we want to use it. In the end, the tasks are dispatched to an existing Executor (which does not have to be a pool, but is the typical use).

Specifications

  • Based on an existing executor (composite)
This was referenced Dec 19, 2017
@Adeynack Adeynack added this to Grooming in Main Dec 19, 2017
@Adeynack Adeynack moved this from Grooming to In progress in Main Dec 19, 2017
@Adeynack Adeynack self-assigned this Dec 19, 2017
@Adeynack Adeynack moved this from In progress to In review in Main Dec 20, 2017
Adeynack pushed a commit that referenced this issue Dec 21, 2017
Adeynack pushed a commit that referenced this issue Dec 21, 2017
Main automation moved this from In review to Done Dec 27, 2017
Adeynack added a commit that referenced this issue Dec 27, 2017
* Create `SequencedExecutor`.

* #8 configure `error-prone` and apply its suggestions

* #1 add tests

* #1 nice catch, M. Error-Prone!

* #1 more strict Java compiling rules + consider warnings as errors

* #1 use @GuardedBy for better error-prone coverage.
Adeynack added a commit that referenced this issue Dec 27, 2017
* Create `SequencedExecutor`.

* #8 configure `error-prone` and apply its suggestions

* #1 add tests

* #1 nice catch, M. Error-Prone!

* #1 more strict Java compiling rules + consider warnings as errors

* #1 use @GuardedBy for better error-prone coverage.

* #9 create Travis configuration file

* #9 try forcing dist to trusty (build failed on gradlew assemble command)

* #9 ensure that gradle-wrapper.jar is included

* #9 show result of individual tests

* #9 show build badge in the README
Adeynack added a commit that referenced this issue Jan 18, 2018
* Create `SequencedExecutor`.

* #3 implement StateGuard's first method 'mutate'

* #8 configure `error-prone` and apply its suggestions

* #1 add tests

* #1 nice catch, M. Error-Prone!

* #1 more strict Java compiling rules + consider warnings as errors

* #1 use @GuardedBy for better error-prone coverage.

* #3 complete StateGuard + tests
+ better tests for SequencedExecutor

* #3 clean up

* #8 avoid raw types (thanks error-prone)

* #3 add failure tests

* #3 add CODEOWNERS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Main
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant