typelevel / catbird Goto Github PK
View Code? Open in Web Editor NEWBirds and cats together
Home Page: http://catbird.io
License: Apache License 2.0
Birds and cats together
Home Page: http://catbird.io
License: Apache License 2.0
The Cats and cats-effect 2.0.0 releases are almost six months old. We have 2.1 releases for both, and will have Cats 2.2.0 soon, and none of these support Scala 2.11. Finch is likely to drop Scala 2.11 before long (e.g.).
There's no particular reason that's come up for us to drop 2.11 here yet, but as soon as it becomes a burden I'm ready to let it go. If someone really needs it, please let us know.
As discussed here, this repository is now in the Typelevel organization. It's not strictly necessary to move the project from io.catbird
to org.typelevel
, but I think it'd be a good idea. This would involve two changes:
io.catbird
to org.typelevel
. This is easy, simplifies publishing rights, and imposes a very small burden on users (just updating the dependency in their build config).io.catbird.*
to org.typelevel.catbird.*
. This is more of a burden on users, but is a completely mechanical change.We could technically just do the first but not the second, but I also think it'd be good to stay consistent, and I'd like to get rid of the io domain at some point (for various reasons).
How do you import the implicit Applicative
for the twitter future? I've got:
import io.catbird.util._
Are there any plans for upgrading Finagle to the most recent version: 22.3.0
?
I can potentially look into taking on the changes if I can get support in getting the PR reviewed/merged/released
@bpholt tagging you since you seem to be active on the repo
Now that Twitter Util is on a <year>.<month>.<patch>
scheme it might make sense for catbird to follow suit. The one downside is that (at least until Cats hits 1.0) we may still want to introduce breaking changes out of sync with the Util / Finagle release cycle, but this seems reasonably easy to work around.
There have been a handful of upstream releases from Twitter. Is there anything blocking a release for 21.8.0
?
Going forward, would it be possible to automatically release upon updates from Twitter, assuming everything passes in CI?
https://github.com/typelevel/catbird/runs/6393978143
It's failing on the MiMa check, because I guess I didn't really set that up properly. Once a versioning/bincompat strategy is decided it'll be clearer what to do.
@bpholt has graciously stepped forward to continue maintaining Catbird. It's always good to have a second maintainer, when either the person or the project gets busy. Volunteers?
Publish for Scala 2.13.x please. Its a dependency of Eff
It would be useful to have a ContextShift
instance as a generic alternative to FuturePool
(eg for blocking io). I think that evalOn
would fulfil this role and should behave essentially as FuturePool
does now.
I'm not sure what shift
should do though. It seems like the main relevant use case would be to improve fairness on cpu-bound work running on a small pool of threads. It could do this by:
Scheduler.flush()
- doesn't switch threads and I think is dangerous to do a lot because it adds stack framesContextShift
instance with a thread pool intended for this purpose and having shift
switch between threads on that pool - but it seems wrong to force the user to provide this pool if all they want to do is use evalOn
Add sbt-typelevel-mergify to the build to help with maintenance. If a maintainer approves a Scala Steward PR, Mergify can automatically merge it for us.
I've confirmed that #45 makes the iteratee.io tests pass, but it would be nice to have a test here that would fail without the fix so that we can be more confident that this doesn't regress again.
There are two reasons I'm reluctant to do this at the moment.
The first is that Cats doesn't yet have non-milestone, non-RC releases for 2.13. For a number of my other projects I've been tracking the pre-final Cats 2.0.0 releases, but this is a library that I'm not personally using at the moment, and that I don't think carries all that much value as an example for testing things out, so I didn't really want to start publishing a bunch of milestones and RCs. Now Cats 2.0.0 is likely only a week or so away, so I think it definitely makes sense to wait.
The second reason is that while the latest release of Twitter Util (19.8.1) introduced support for Scala 2.13 a couple of weeks ago, Finagle doesn't support 2.13 yet. I hate maintaining builds where submodules have different cross-versions, so my plan was to wait for Finagle.
That said, if someone wants to open a PR updating to Cats 2.0.0-RC2 and setting up the build so that cross-building and publishing works cleanly, I'd be happy to review it and run the release. Otherwise this will wait for Cats 2.0.0 and Finagle.
Would LiftIO
instances for Future
and Rerunnable
be welcomed? I couldn't find laws for LiftIO
but these rough implementations seemed to work after some limited testing I did.
implicit val rerunnableLiftIO: LiftIO[Rerunnable] = new LiftIO[Rerunnable] {
override def liftIO[A](ioa: IO[A]): Rerunnable[A] =
Rerunnable.fromFuture(LiftIO[Future].liftIO(ioa))
}
implicit val futureLiftIO: LiftIO[Future] = new LiftIO[Future] {
override def liftIO[A](ioa: IO[A]): Future[A] = {
val p = Promise[A]
ioa.unsafeRunAsync {
case Left(ex) => p.setException(ex)
case Right(a) => p.setValue(a)
}
p
}
}
I think Scala steward is updating this repo under its old location. We can remove it and add it to the Typelevel steward instead.
There are a few uses of Await
in typeclass instances provided by util
: Eq
and Comonad
for Future
and Rerunnable
.
I suspect the Eq
instances are only intended for testing, in which case they could just be moved into test
. I'm not sure what the Comonad instances are for at all - I can't envisage a use for them personally.
So my initial suggestion is:
Eq
instances into test
Comonad
instances into an unsafe
or maybe alleycats
subpackage with some docs to make it clear to the user what they're getting into (alternative option: just remove them)I would be happy to do the gruntwork if a change is agreed on.
Currently, I don't see a method to take several Rerunnables and run them in parallel (like IO.Par
allows in cats-effect).
Even a method on the companion: def parSequence[F[_]: Traverse, A](as: F[Rerunnable[A]]): Rerunnable[F[A]]
would be very nice to have.
I think this is possible, but a bit of work. Could be useful for a few cases I can think of at Stripe.
I have a file that uses com.twitter.bijection.twitter_util.UtilBijections._
with com.twitter.bijection.Conversion.asMethod
extensively to convert from com.twitter.util.Future
to scala.concurrent.Future
.
I'm introducing cats' EitherT
into that file to be used with com.twitter.util.Future
s and need a cats.Functor[com.twitter.util.Future]
to do that so I added import io.catbird.util._
.
Unfortunately it seems to conflict with bijection somehow, giving me errors like this on each use of the bijection conversion:
[error] /Users/omer/code/sigma-monorepo/src/jvm/com/thesigma/server/graphql/schema/main/SigmaSchema.scala:2206: missing argument list for method as in trait Ops
[error] Unapplied methods are only converted to functions when a function type is expected.
[error] You can make this conversion explicit by writing `as _` or `as(_)` instead of `as`.
[error] ).as[ScalaFuture[Connection[OrgActivity]]]
ScalaFuture
here is scala.concurrent.Future
and as
is being called on something with type com.twitter.util.Future[Connection[OrgActivity]]
.
I don't see another as
defined anywhere in the catbird source so have no clue where to start trying to fix this. Any suggestions? I can create a small repo demonstrating the issue if it's helpful/necessary. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.