Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runHost function #305

Closed
wants to merge 6 commits into from
Closed

runHost function #305

wants to merge 6 commits into from

Conversation

ElvishJerricco
Copy link
Contributor

Adding a function for creating new hosts with PerformEvent and PostBuild easily. Currently having some trouble getting it to work in the context we need, and haven't documented it yet, so WIP

Copy link
Member

@ryantrinkle ryantrinkle left a comment

Choose a reason for hiding this comment

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

This looks good, but I'd like to review it in the context of a paired commit that uses this in reflex-dom.


type EventChannel t = Chan [DSum (EventTriggerRef t) TriggerInvocation]

runHost
Copy link
Member

Choose a reason for hiding this comment

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

Let's give this a slightly longer name, like runHostWithIO, to indicate that it grants access to IO. I don't want people to get the impression that all hosts can/should support IO.

@dalaing
Copy link
Contributor

dalaing commented May 2, 2019

If you wanted to take anything from https://github.com/qfpl/reflex-basic-host/blob/master/src/Reflex/Host/Basic.hs for this, feel free.

It started life as almost exactly what you have here, then I needed the ability to sometimes use an Event to shutdown the host, which is where it started to diverge, and then I needed a newtype and the various instances to use this in a context where the pile-o'-constraints approach was giving me grief.

@ryantrinkle
Copy link
Member

ryantrinkle commented May 3, 2019 via email

@dalaing
Copy link
Contributor

dalaing commented May 3, 2019

I've been looking at adding that kind of event to as many of the reflex-dom backends as I can, for use with criterion and QuickCheck/Hedgehog...

@ryantrinkle
Copy link
Member

@dalaing It sounds like it would be great to base reflex-dom on that!

@ali-abrar
Copy link
Member

It would be nice if something like this also worked with reflex-vty.

@ali-abrar
Copy link
Member

@Ericson2314
Copy link
Member

Ericson2314 commented Jan 10, 2020

OK Good CI works. Next steps are:

  1. Make reflex-vty use this, changing as needed
  2. Take documentation from reflex-vty
  3. Fix up WIP: Use runHostWithIO reflex-dom#312

@endgame
Copy link
Contributor

endgame commented Sep 24, 2020

Is this still relevant given that Reflex.Host.Headless has been released?

@ali-abrar
Copy link
Member

I think the point of this was to provide something to make it easier to implement headless, vty, or other hosts.

@ali-abrar ali-abrar closed this Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants