Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Tim Spence
    @TimWSpence
    Timer[IO].sleep(n.micros) this shouldn’t block a thread, should it? If I add a 0 to the random int bound then the whole program seems to block sometimes
    Christopher Davenport
    @ChristopherDavenport
    It shouldn’t block on a thread I believe
    Tim Spence
    @TimWSpence
    Yeah, I didn’t think so. I’ve probably done something else stupid
    Tim Spence
    @TimWSpence
    @ChristopherDavenport good news! After a 7 month sebatical (to be fair, I was on paternity leave for quite a bit of it), I’ve fixed our issues with this :)
    (Or at least the Santa Claus example now behaves as expected)
    I’ve published 0.6.0 with the changes
    Ross A. Baker
    @rossabaker
    :tada: Welcome back, and congrats!
    Tim Spence
    @TimWSpence
    Thanks @rossabaker :)
    Although I’m now having mima problems :sob: Is it obvious to anyone here what the problem is with https://travis-ci.com/TimWSpence/cats-stm/jobs/285934093 and why it’s only a problem on 2.12.x?
    Ross A. Baker
    @rossabaker
    cats-effect had an issue where it had to add exceptions. I can dig it up after my meeting, but this reminds me of that.
    Tim Spence
    @TimWSpence
    Great, thanks! I can always just bump the version again to get rid of it as it’s not stable yet so I don’t really care
    but obviously I shouldn’t have to!
    Christopher Davenport
    @ChristopherDavenport
    This is great news!
    Ross A. Baker
    @rossabaker
    Sorry, I got distracted and failed to report back.
    The MiMa errors reminded me of typelevel/cats-effect#770, but it looks like you found a workaround.
    Tim Spence
    @TimWSpence
    Thanks Ross. Yeah, just bumped the version to get rid of it :joy:
    renghen
    @renghenKow_twitter
    hi
    the library is interesting
    do you have a java api, so that I can use the lib in kotlin or java
    not everyone gets to use scala in thei job
    Tim Spence
    @TimWSpence
    Thanks @renghenKow_twitter The implementation is pretty tied to Scala's cats effect so I think a Java API would be tied to that as well. I'd be surprised if Cats Effect supports Java at all (no implicits or higher kinded types for a start) but @ChristopherDavenport or @rossabaker might be able to give you more details - I've never tried to use it from Java
    renghen
    @renghenKow_twitter
    Thanks very much for the answer
    was thinking of a wrapper
    like scala-stm does it
    Tim Spence
    @TimWSpence
    No worries! As I said, I think a wrapper would be hard because the scala features we use don't easily map to Java (as far as I'm aware anyway) but I'm very happy to consider PRs that don't break the scala UX!
    Ross A. Baker
    @rossabaker
    I guess if you run javap on the classes of cats-stm, you'd get some sense of how those Scala features map to Java.
    I used to call Scala from Java a lot, but that was before I'd heard of higher-kinded types.
    And I think the wrapper would be the most promising approach, like scala-stm's JAPI.
    Faiaz Sanaulla
    @fsanaulla

    Hello @TimWSpence
    Thank you for a great project!

    I’m trying to share stm between several implementations:

    abstract class Store[F[_]](stm: STM[F]) {
       def get(id: String): stm.Txn[Option[..]]
    }

    but it's impossible because of:

    private value stm escapes its defining scope as part of type

    What workaround you can suggest?

    Oleg Pyzhcov
    @oleg-py
    use val stm? :D
    Tim Spence
    @TimWSpence
    Hey @fsanaulla! So sorry I’ve just seen this - I’ve mostly swapped to the typelevel discord (https://discord.gg/XF3CXcMzqD) since it opened. There’s a channel for cats-stm there but I forgot to update the cats-stm docs so apologies about that!
    Your question is a great one actually. The fact that Txn is path-dependent does make it a pain sometimes. Did you try what Oleg suggested?
    And thanks for your kind words! :) how are you getting on with the library generally? I’m alway looking for feedback!