Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 29 2020 10:23
    shankarshastri starred reactor/reactor-scala-extensions
  • Dec 28 2020 23:08
  • Dec 14 2020 17:49
    simonbasle edited #75
  • Dec 14 2020 17:49
    simonbasle edited #75
  • Dec 14 2020 17:49
    simonbasle edited #75
  • Dec 14 2020 17:07
    sinwe closed #75
  • Dec 14 2020 17:07

    sinwe on Use_github_action

    (compare)

  • Dec 14 2020 17:07

    sinwe on master

    Removed circleci #75 Updated scala 2.12.12, 2.13.4 a… Notify via telegram and 3 more (compare)

  • Dec 14 2020 17:07
    sinwe closed #76
  • Dec 14 2020 17:05
    codecov[bot] commented #76
  • Dec 14 2020 17:05
    codecov[bot] commented #76
  • Dec 14 2020 17:05
    sinwe synchronize #76
  • Dec 14 2020 17:05

    sinwe on Use_github_action

    Remove .travis.yml (compare)

  • Dec 09 2020 16:55
    codecov[bot] commented #76
  • Dec 09 2020 16:53
    codecov[bot] commented #76
  • Dec 09 2020 16:53
    codecov[bot] commented #76
  • Dec 09 2020 16:53
    sinwe synchronize #76
  • Dec 09 2020 16:53

    sinwe on Use_github_action

    Always notify via telegram (compare)

  • Dec 09 2020 16:21
    codecov[bot] commented #76
sinwe
@sinwe
@/all anyone of you familiar with Cats-effect? I’m trying to make this library to have cats-instance, but I’m stucked with the tailRecM that I can’t make the stack constant
Ryan Scheidter
@rs017991
@sinwe, I've barely scratched the surface with Cats, but I did come across:
Cats has chosen to require this method of all monad implementations as opposed to just a subset
So this problem would really need to be solved to be consider an acceptable Monad
But I also came across: reactor/reactor-core#2147
suggesting that stack-safe flatMap is simply not going to be possible for the foreseeable future
So it's probably safe to assume that Monad cannot be a part of this extensions layer
That said, it looks like you're only interiting Monad due to the use of 'Bracket'
so if you're willing to give up Bracket, then a subset of these other operations should still be doable
sinwe
@sinwe

so if you're willing to give up Bracket, then a subset of these other operations should still be doable

Partly yes, this is when I encounter problem that when I use resources that needs to be closed depending on the outcome, it’s not easy to write the code. And I found this bracket code and found it easy to use it. So I apply it here.

Ryan Scheidter
@rs017991
Noticed today that reactor.util.context.Context has a getOrEmpty method that returns a JDK8 Optional.
Perhaps we should add an implicit getOrNone method that returns a Scala Option
What do you think? And where would we put it?
sinwe
@sinwe
I don’t think I’ve touched on the Context.
sinwe
@sinwe
Perhaps something like this?
package reactor.util.scala.context

import reactor.util.context.Context

object SContext {
  implicit class ContextOps(context: Context) {
    def getOrNone[T](key: AnyRef): Option[T] = {
      val x = context.getOrEmpty[T](key)
      if(x.isPresent) Option(x.get())
      else None
    }
  }
}
sinwe
@sinwe
I just don’t like the name… I prefer to use def get[T](AnyRef): Option[T], but I’m sure it’ll be conflicting with Context.get(Object): T
Ryan Scheidter
@rs017991
Yeah my thought was to name it in line with the existing method (Scala equivalent of Optional.empty being None)
how about putting on the context package object?
2 replies
Ryan Scheidter
@rs017991
Side thought: the original getOrEmpty type param is just for convenience and can't actually perform a type check(throwing a ClassCastException if it's not of type T),
but in Scala we have the opportunity to use a TypeTag and return None in the case that there is a value for the key, but of the wrong type.
2 replies
sinwe
@sinwe
I’ve raised #72 to removes deprecated caused by using Scala 2.13, such as using Stream instead of LazyList. Some will cause breaking changes (especially when returning Stream, it is now returning LazyList). But those with parameterStream, I made it deprecated and provide another operator using LazyList.
Please have a look and see if it makes sense
sinwe
@sinwe
@rs017991 @jpork Can you review #74?