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

Semaphore #1151

Merged
merged 26 commits into from
Nov 22, 2018
Merged

Semaphore #1151

merged 26 commits into from
Nov 22, 2018

Conversation

nomisRev
Copy link
Member

No description provided.

@raulraja
Copy link
Member

Exception in thread "main"

import arrow.effects.*
import arrow.effects.instances.io.async.async
import arrow.effects.instances.io.monad.flatMap

fun main(args: Array<String>) {
  //sampleStart
  val semaphore = Semaphore.uncancelable<ForIO>(5, IO.async())

  semaphore.flatMap { s ->
    s.acquireN(6)
  }.unsafeRunTimed(3.seconds) == IO.never().unsafeRunTimed(3.seconds)

  semaphore.flatMap { s ->
    s.acquireN(5).flatMap. {
      s.available
    }
  }.unsafeRunSync() == 0
  //sampleEnd
}

�[31merror: unresolved reference: seconds
}.unsafeRunTimed(3.seconds) == IO.never().unsafeRunTimed(3.seconds)
^
error: expression 'never' of type 'IO' cannot be invoked as a function. The function 'invoke()' is not found
}.unsafeRunTimed(3.seconds) == IO.never().unsafeRunTimed(3.seconds)
^
error: unresolved reference: seconds
}.unsafeRunTimed(3.seconds) == IO.never().unsafeRunTimed(3.seconds)
^
error: function invocation 'flatMap(...)' expected
s.acquireN(5).flatMap. {
^
error: no value passed for parameter 'arg1'
s.acquireN(5).flatMap. {
^
error: type inference failed: Not enough information to infer parameter B in fun <A, B> Kind<ForIO, A>.flatMap(arg1: (A) -> Kind<ForIO, B>): IO
Please specify it explicitly.

s.acquireN(5).flatMap. {
              ^

error: the expression cannot be a selector (occur after a dot)
s.acquireN(5).flatMap. {
^
�[0m

Task :arrow-docs:runAnk FAILED

@codecov
Copy link

codecov bot commented Nov 22, 2018

Codecov Report

Merging #1151 into master will increase coverage by 0.22%.
The diff coverage is 65.21%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1151      +/-   ##
============================================
+ Coverage      42.4%   42.62%   +0.22%     
- Complexity      818      820       +2     
============================================
  Files           403      404       +1     
  Lines         11292    11355      +63     
  Branches       1262     1272      +10     
============================================
+ Hits           4788     4840      +52     
- Misses         6118     6125       +7     
- Partials        386      390       +4
Impacted Files Coverage Δ Complexity Δ
...w-effects/src/main/kotlin/arrow/effects/Promise.kt 61.9% <100%> (ø) 0 <0> (ø) ⬇️
...effects/src/main/kotlin/arrow/effects/Semaphore.kt 63.49% <63.49%> (ø) 0 <0> (?)
...arrow-effects/src/main/kotlin/arrow/effects/Ref.kt 76.31% <66.66%> (ø) 0 <0> (ø) ⬇️
.../arrow-effects/src/main/kotlin/arrow/effects/IO.kt 81.25% <0%> (+1.25%) 16% <0%> (ø) ⬇️
...effects/src/main/kotlin/arrow/effects/IORunLoop.kt 74.14% <0%> (+1.95%) 49% <0%> (+2%) ⬆️
...ics/src/main/kotlin/arrow/optics/instances/mapk.kt 90.47% <0%> (+4.76%) 0% <0%> (ø) ⬇️
...nces/src/main/kotlin/arrow/effects/instances/io.kt 51.16% <0%> (+9.3%) 0% <0%> (ø) ⬇️
...es-core/src/main/kotlin/arrow/instances/boolean.kt 33.33% <0%> (+33.33%) 0% <0%> (ø) ⬇️

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 618ec34...e50589f. Read the comment docs.

@nomisRev
Copy link
Member Author

@raulraja

@raulraja raulraja merged commit ee0d4f3 into master Nov 22, 2018
@nomisRev nomisRev mentioned this pull request Nov 22, 2018
@raulraja raulraja deleted the simon-semaphore branch November 25, 2018 00:18
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.

2 participants