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

AsyncFunc: executor service as a field #330

Merged
merged 2 commits into from
Jul 20, 2017
Merged

AsyncFunc: executor service as a field #330

merged 2 commits into from
Jul 20, 2017

Conversation

caarlos0
Copy link
Contributor

may avoid the premature termination of the executor service...

@codecov-io
Copy link

codecov-io commented Jul 19, 2017

Codecov Report

Merging #330 into master will increase coverage by 0.18%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #330      +/-   ##
============================================
+ Coverage     74.22%   74.41%   +0.18%     
- Complexity      424      431       +7     
============================================
  Files           131      132       +1     
  Lines          1424     1450      +26     
  Branches         68       69       +1     
============================================
+ Hits           1057     1079      +22     
- Misses          347      351       +4     
  Partials         20       20
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/cactoos/func/AsyncFunc.java 85.71% <100%> (+2.38%) 6 <3> (+1) ⬆️
src/main/java/org/cactoos/io/ReaderAsInput.java 100% <0%> (ø) 5% <0%> (?)
...c/main/java/org/cactoos/func/FuncWithFallback.java 27.45% <0%> (+0.78%) 4% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d46fb6f...b7786f3. Read the comment docs.

@@ -91,12 +92,12 @@ public AsyncFunc(final Proc<X> proc, final ThreadFactory fct) {
*/
public AsyncFunc(final Func<X, Y> fnc, final ThreadFactory fct) {
this.func = fnc;
this.factory = fct;
this.executor = Executors.newSingleThreadExecutor(fct);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caarlos0 I believe that this ctor must become a secondary one. We should introduce a primary one, which will accept Func and ExecutorService.

@yegor256
Copy link
Owner

@caarlos0 thanks, see my comment above

@caarlos0
Copy link
Contributor Author

@yegor256 pushed

@caarlos0 caarlos0 changed the title executor service as a field AsyncFunc: executor service as a field Jul 20, 2017
@caarlos0
Copy link
Contributor Author

caarlos0 commented Jul 20, 2017

this also close #324

@yegor256
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jul 20, 2017

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit b7786f3 into yegor256:master Jul 20, 2017
@rultor
Copy link
Collaborator

rultor commented Jul 20, 2017

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 11min)

@caarlos0 caarlos0 deleted the fnasync branch July 20, 2017 21:25
@caarlos0
Copy link
Contributor Author

@yegor256 can you deploy it please?

@yegor256
Copy link
Owner

@caarlos0 see 0.11.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants