Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 04:19
    404- forked
    404-/fs2
  • Jan 31 03:01
    SethTisue commented #1232
  • Jan 30 17:22
  • Jan 30 13:45
  • Jan 30 10:48
    pchlupacek commented #1406
  • Jan 30 10:47
    pchlupacek commented #1406
  • Jan 30 10:39
    pchlupacek commented #1407
  • Jan 30 09:58
    lJoublanc commented #870
  • Jan 30 09:42
    vladimir-popov commented #1407
  • Jan 30 08:10
    vladimir-popov closed #1407
  • Jan 30 08:10
    vladimir-popov commented #1407
  • Jan 29 19:20
    SystemFw commented #1407
  • Jan 29 19:20
    SystemFw commented #1407
  • Jan 29 18:57
    SystemFw commented #1406
  • Jan 29 17:47
    pchlupacek commented #1406
  • Jan 29 17:42
    pchlupacek commented #1406
  • Jan 29 17:39
    pchlupacek commented #1407
  • Jan 29 17:39
    vladimir-popov edited #1407
  • Jan 29 17:38
    vladimir-popov commented #1406
  • Jan 29 17:37
    pchlupacek commented #1406
Paulius Imbrasas
@CremboC
hey @SystemFw , we're running a service reading from Google PubSub, and we occassionaly this beautiful stack trace: https://gist.github.com/CremboC/6f3f158bd32720890e47519211a1a71d (sorry it's in one line, but you'll see a pattern quickly!). any ideas?
Fabio Labella
@SystemFw
@CremboC what version are you on?
this was fixed in 0.10.3
Paulius Imbrasas
@CremboC
ah, on 0.10.1
I assume they're backwards compatible?
Fabio Labella
@SystemFw
yep
Paulius Imbrasas
@CremboC
coolio, will update, danke!
Justin Heyes-Jones
@justinhj
I've been trying to write a function that streams until it has seen N objects equal to a provided instance of O. The last piece of the puzzle is how to emit the stream. I think I need to pull output but somehow need to join that to the tail of the stream in the recursive call? https://gist.github.com/justinhj/10fd8dc2a364a1fdbade36352b15abe0
Peter Aaser
@PeterAaser
I'm not sure what you are trying to do here
maintaining a list, but with Pipe[F,O,O] as type seems incompatible
Pull.output1 might be what you want to use
typically you compose Pulls with >>
how about
s.pull.uncons1.flatMap {

            case Some((o, tl)) =>

              if(o == thing) {
                output1(o) >> go(tl, n - 1)
              }
              else {
                output1(o) >> go(tl,n)
              }

            case None =>
              Pull.done
does that seem like what you are after @justinhj
Peter Aaser
@PeterAaser
Pull forms a monad in R btw, so >> is just myPull.flatMap{ _ => ... } if that helps any (but this is in no way necessary to understand for using pulls)
Jose C
@jmcardon
@PeterAaser sort of useful when you need to evaluate effects in a Pull though
since eval returns it in R not O
Fabio Labella
@SystemFw
@justinhj you need to Pull.output/output1 as @PeterAaser says, before recursing (using >> to tie things)
another problem is that you are accumulating a List[O] as your output
actually that's the confusion
you are used to the typical accumulator based thing, where you first accumulate the whole result and then you "return it"
but here you want to do this in a streaming fashion, so as soon as you find something that needs to be emitted, you just emit it
and Pull.output/output1 is the command that lets you do so
Fabio Labella
@SystemFw
I can explain the idea behind Pull a bit more in depth, if you want
Peter Aaser
@PeterAaser
To make it very clear, imagine if the stream never reaches enough elements to halt
in that case it would never emit!
When I started out I wish I'd ask what @SystemFw is offering @justinhj
so you should say yes!
Gavin Bisesi
@Daenyth
@SystemFw I'd be interested in hearing about it
Peter Aaser
@PeterAaser
What being pull based entailed did not fully dawn on me for a long while
it was a huge missing piece for me in my internal model of how fs2 worked
Fabio Labella
@SystemFw
@Daenyth sure
I was going on to add a little interlude on how to view effects as languages, but I can skip that if you want
and only focus on Pull
wdyt?
jmcardon @jmcardon gathers for grand wizard Fabio's mini-talk
Fabio Labella
@SystemFw
:P
Peter Aaser
@PeterAaser
how do I do that
the purple text thingy
PeterAaser @PeterAaser attempts to read documentation
Peter Aaser
@PeterAaser
wow, who would have thought
PeterAaser @PeterAaser gathers around the fireplace as the shaman prepares to commune with the spirits of Pull
Fabio Labella
@SystemFw
:joy:
ok enough, I'll better start
although I kind of prefer for the interested people to be there, so they can ask questions if I'm not making any sense...
Peter Aaser
@PeterAaser
Yeah, we should see if he comes back
he must be initiated! He must write his first pipe and be accepted by the tribe as an adult
Gavin Bisesi
@Daenyth
I'm here
sorry