Skip to content

Conversation

armanbilge
Copy link
Member

All the pieces were already here, including a test, so not sure why this wasn't already exposed.

@mergify mergify bot added series/0.23 PRs targeting 0.23.x module:core labels May 25, 2022
Copy link
Member

@rossabaker rossabaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought there was a reason, but I didn't document it and don't remember it.

@armanbilge
Copy link
Member Author

Did a dive into git history but couldn't find anything. I like this better than wrapping the browser EventSource API in http4s-dom.

@armanbilge armanbilge merged commit e94c9d4 into http4s:series/0.23 May 25, 2022
@armanbilge
Copy link
Member Author

@rossabaker I found some discussion on this in #619, I still need to digest it but does anything there jog your memory?

@rossabaker
Copy link
Member

I guess it was having a decoder that produced the prehistoric equivalent of F[Stream[F, Event]] was distasteful? You probably want to Stream.eval the decoded result from this?

@armanbilge
Copy link
Member Author

armanbilge commented May 26, 2022

Or Stream.force maybe? I did notice that, and it's slightly awkward, but I can't see why it's that big a deal.

In theory we could add a special syntax for it roundabouts here:

final def as[A](implicit F: MonadThrow[F], decoder: EntityDecoder[F, A]): F[A] =

e.g.

final def asStream[A](implicit F: MonadThrow[F], decoder: EntityDecoder[F, Stream[F, A]]): Stream[F, A] =
  Stream.force(as[Stream[F, A]])

Otherwise not really sure what we could do about it.

@armanbilge
Copy link
Member Author

I thought there was a reason, but I didn't document it and don't remember it.

Well, we figured out why 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:core series/0.23 PRs targeting 0.23.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants