Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 30 08:43
    israelperezglez edited #679
  • Nov 30 05:13

    47erbot on main

    Update cats-effect to 3.4.2 (compare)

  • Nov 30 05:13

    47erbot on cats-effect-3.4.2

    (compare)

  • Nov 30 05:13
    47erbot closed #680
  • Nov 30 05:07
    47erbot opened #680
  • Nov 30 05:07

    47erbot on cats-effect-3.4.2

    Update cats-effect to 3.4.2 (compare)

  • Nov 29 16:19
    israelperezglez converted_to_draft #679
  • Nov 29 16:19
    israelperezglez opened #679
  • Nov 29 16:18

    israelperezglez on integration-xebia-functional

    upgrade 47degrees to xebia-func… (compare)

  • Nov 25 05:15

    47erbot on main

    Update sbt-scalajs, scalajs-com… (compare)

  • Nov 25 05:15

    47erbot on sbt-scalajs-1.12.0

    (compare)

  • Nov 25 05:15
    47erbot closed #678
  • Nov 25 05:09
    47erbot opened #678
  • Nov 25 05:09

    47erbot on sbt-scalajs-1.12.0

    Update sbt-scalajs, scalajs-com… (compare)

  • Nov 23 11:24
    fedefernandez synchronize #664
  • Nov 23 11:24

    fedefernandez on sbt-ci-release-1.5.11

    Update sbt to 1.7.3 Update scalafmt-core to 3.6.1 Update scala3-library to 3.2.1 and 8 more (compare)

  • Nov 23 05:16

    47erbot on main

    Update sbt-github, sbt-github-h… (compare)

  • Nov 23 05:16

    47erbot on sbt-github-0.11.6

    (compare)

  • Nov 23 05:16
    47erbot closed #677
  • Nov 23 05:08
    47erbot opened #677
Peter Neyens
@peterneyens
@justinhj Nice!
The reftree visualization looks quite nice indeed.
Justin Heyes-Jones
@justinhj
Yeah it's a neat library
Raúl Raja Martínez
@raulraja
@justinhj awesome post and project!
Justin Heyes-Jones
@justinhj
Thanks!
Taleb Zeghmi
@talebzeghmi
Does anyone use the Fetch API in production?
Tom Adams
@tomjadams
Yes. Have done for months.
Taleb Zeghmi
@talebzeghmi
Has anybody found a Redis Scala API that supports Cluster pipelining?
Justin Heyes-Jones
@justinhj
I'm using https://github.com/etaty/rediscala which should in theory but I don't know if it allows pipelining what you want specifically as I haven't used the cluster support yet.
Taleb Zeghmi
@talebzeghmi
rediscala purports to support pipeline but uses transactions
Aarsh Shah
@aarshkshah1992
Hello Guys
I am Aarsh , a Scala dev looking to contribute to some open source projetcs
Is it possible for me to work on Fetch
Considering that it's been developed by 47 degrees ?
Raúl Raja Martínez
@raulraja
@aarshkshah1992 of course! your contributions will be very welcomed!
Aarsh Shah
@aarshkshah1992
Thanks for the reply . Is there a contributing guide I can look into ?
Also, any list of planned features / issues/ bug fixes I can work on to get my foot in the door ? Would really appreciate the help.
Raúl Raja Martínez
@raulraja
no guide at the moment since it's a self contained and small library, feel free to glance over the issues and pick up any of the current open ones and ask any questions here :)
Aarsh Shah
@aarshkshah1992
Great, thanks a lot :smile:
Raúl Raja Martínez
@raulraja
:thumbsup:
Tom Adams
@tomjadams
Silly question, has anyone tried to use fetch from java? Or, know a similar library that’s usable from java?
kerr
@hepin1989
@tomjadams You will need to wrote a wrapper around it
Tom Adams
@tomjadams
@hepin1989 Thanks, that’s what I figured.
Raúl Raja Martínez
@raulraja
Java has no way to represent scala higher kinds and some of the methods would need to be made concrete or specialized. Same for the implicit resolution would have to be wrapped in a scala project that exposes concrete types and already resolved instances with signatures compatible in Java. If you plan on going down that rabbit hole we'd welcome such a submodule in Fetch itself
You probably want ListenableFuture<A> as result type from guava, we have instances to go to that and back in Freestyle async so a Fetch in terms of scala.concurrent.Future can just be ~> to guava's ListenableFuturepotentially.
Tom Adams
@tomjadams
Thanks for the info @raulraja. The async story in Java is pretty ordinary.
We have a lot of code that mixes concurrency with data access, and some of that data access has hand rolled caches. We also have some future need to be able to see the input state of some data into (the equivalent of) a Fetch, and I think the patterns in Fetch would suit this quite well.
We’re also looking at other things like atomix, I don’t know enough yet though about our use case and future use case to be able to make concrete plans though.
Raúl Raja Martínez
@raulraja
Cool!, as mentioned if you end up building this atop Fetch let us know and we'll help in whatever we can. 😀
Tom Adams
@tomjadams
👍🏼
Florian Witteler
@FloWi
Hey guys! Thanks for creating fetch! Made my day :) Also kudos to that awesome documentation. Can't wait to give it a try
Raúl Raja Martínez
@raulraja
@FloWi thanks for the kind words :clap:
Basti
@lunaryorn
Hi, I'm considering fetch to simplify some of my data fetches accross our services, but I'm facing a question: We've got an ubiquituous "request context" which contains authentication, tracing IDs, etc. When I call a service in a data source I must pass the incoming request context; but I see no "context" support in fetch. How'd I model this?
Raúl Raja Martínez
@raulraja
@lunaryorn hi! how are you currently passing that context in code non related to Fetch? Implicits, Kleisli?. If you can provide a minimal sample code we can probably help you define a DataSource instance that would help you with that context.
Basti
@lunaryorn
@raulraja As an explicit argument; I call someService.someEndpoint(requestContext, someParameter). The context itself comes from the thrift handler, and gets passed by the invoking service.
I can't move to implicits or arrows w/o signifcant refactoring, unfortunately
Justin Heyes-Jones
@justinhj

I'm curious about this too. It seems like you can't extend DataSource to do this since you'd need to change the fetch method itself. @lunaryorn's request seems similar to the way the DataSourceCache works... given a DataSourceIdentity it knows how to check a cache (that is mutated across subsequent fetch executions.

Maybe to solve this kind of issue you'd need a similar implicit type (something like DataSourceContext), which given a DataSourceIdentity knows how to both retrieve or create the context for that entity and also modify it after the fetch.

If that makes sense.

Raúl Raja Martínez
@raulraja
sorry it took me so long to get back to this, I think you can just apply the data source implicitly locally with whatever constructions params you need per call. something along the lines of?
def doInRequestContext(ctx: Context, p: Param): ? = {
   implicit val dataSource = CustomDataSource(ctx, p)
   doWithFetchImplicitDS()
}
wouldn't something like that works to not just in fetch but to inject parameters into any arbitrary type class instances?
Basti
@lunaryorn
@raulraja I thought about this as well; I just wasn't sure whether it's "intended" use of this library, ie, whether we should instantiate data sources locally. But I'll try and see how it goes, many thanks for your help :+1:
Justin Heyes-Jones
@justinhj
Ah, that's a nice and simple solution. I thought the question was how to pass a specific context based on the data source id
Raúl Raja Martínez
@raulraja
I think if type classes where coherent and global in Scala this would be a pain but given you can just use scoped implicits there is no limitation as to the scope in which implicits are contructed and therefore can see their outside world including being provided inside functions that provide the context.
@lunaryorn there is no policies as to intended use so we just follow whatever Scala let's you do for creating data sources. I think if you use global ones you can just provide global implicit instances but in case where you need access to a context like this case they need to be provided in place since global ones would most likely be singletons. You can also provide them globally if you make the ctx and p there be themselves implicits and you only provide those there. This is similar to what play framework does with { implicit request =>
Basti
@lunaryorn
@raulraja I think I'd follow play's approach then, and make data source constructors take implicit parameters for the request context. I'll try and see how it works out for me. Thanks for your help and your recommendations
Raúl Raja Martínez
@raulraja
@lunaryorn sounds good, let us know if you find any shortcomings with that approach, cheers!
Dermot Haughey
@hderms
Will fetch ever have destructive updates or is this always a read oriented system
Raúl Raja Martínez
@raulraja
@hderms at the moment it's read oriented but there have been discussion in the past around allowing writes. Nobody has been motivated enough to implement a POC around that though since does not seem to be a common use case for current users. If you'd like to take a shot at it we could offer guidance with any questions around Fetch.
Binh Nguyen
@ngbinh

If I have one single data source (think of a document db that stores JSON documents). Then the data source can be like:

implict object JsonStore extends DataSource[String, JSON]{
  def name: String = ???
  def fetchOne(id: Identity): Query[Option[Result]] = ???
  def fetchMany(ids: NonEmptyList[Identity]): Query[Map[Identity, Result]] = ???
}

Now, we store more than one kinds of document there. Says, User and Post. We also have UserId and PostId that basically wrap a String and enforce certain format for each ids. And UserModel and PostModel are case classes that could be serialized to JSON. What is the right way to have two data sources that return both data types and can batch and cache results for both?

Thanks

Taleb Zeghmi
@talebzeghmi

Hi,
Playing with introduction code http://47deg.github.io/fetch/docs.html#introduction-0

  for {
    x: User <- getUser(1)
  } yield s"${x.id} ${x.username}

Produces following error:
Error:(105, 23) value filter is not a member of fetch.Fetch[User]

Thoughts on how to get around this?

Taleb Zeghmi
@talebzeghmi

got help in cats room:
@emilypi

because for comprehensions are implemented poorly.
every time you have a predicate on your type like : Type or if foo, it calls withFilter