-
-
Notifications
You must be signed in to change notification settings - Fork 715
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
Make the event channel tappable so that events can be inspected by third parties. #118
Conversation
With #107 this should be trivial to implement in any re-frame app, not in the library. |
@pupeno Thanks for this. A few thoughts:
|
Is 3 possible already with re-frame or would that be something that requires implementing? |
3 would require implementing too. The main concern I have with this whole idea is that it changes the contract of re-frame from a black box, towards exposing the internals to the programmer. I'm it saying no, but it needs to be considered carefully. |
Yes, I understand. I would personally not worry too much about point 1. I think think tapping the channel should be considered a dangerous thing to do and only do it if you know what you are doing. Point 2 makes that discussion irrelevant though. Can I ask, what do you plan on using instead of core.async? I found reassuring that re-frame's internals were using the well known and popular core.async. I think 3 would be the best way to go. I think global handlers and global middlewares could be very useful. BTW, I'm in slack, as pupeno in the re-frame channel if you want to sync up. |
@pupeno where did we get to with this? Do you still need a hook to see events? The router loop no longer uses core.async so it would have to be a callback or some such. |
@mike-thompson-day8 yes, I would still need this. Shall we talk about it sometime next week? Would that be ok? I think chatting about it could be much faster to make progress. |
Okay, sure. I have no experience with your usecase. |
Are you able to just look at the |
I suspect that for your use case, you could just poll the queue state? |
I don't know, I'll check the new code. J. Pablo Fernández [email protected]
|
Sorry to be so slow to this @pupeno. But we're on it now. Let's fix this and push a new release. I'm not very knowledgeable about your usecase (I've never had to do prerendering), so I'm very happy to be guided by you on this. Have I got this straight: the goal is to have a "hook" which allows code to listen for dispatched events? If so, the questions which come to mind are:
Happy to do a hangout if that works for you. Like I said, I feel pretty ignorant of the requirements here. I won't be able to see the subtleties in the choices. |
Thank you Mike for looking into this. Yeah, let's do a hangouts and iron On 4 December 2015 at 22:36, Mike Thompson [email protected] wrote:
J. Pablo Fernández [email protected] (http://pupeno.com) |
Yeah, I'm mostly free on Sunday. Sometime in the evening would be easiest for me, but there are other options if necessary. We'll use this: http://www.timeanddate.com/worldclock/meeting.html I'm in Sydney. What timezone are you in? |
I'm in London. I'll ping you as soon as I wake up. That should work out On 5 December 2015 at 03:42, Mike Thompson [email protected] wrote:
J. Pablo Fernández [email protected] (http://pupeno.com) |
Previously, to sleep for a little while and let re-frame process events, I was doing this: (cljs.core.async/timeout 300) More details here: https://github.com/carouselapps/prerenderer/blob/master/src/cljs/prerenderer/re_frame.cljs#L17 What would be the appropriate method with the new queue system? That one doesn't seem to work. |
Call the appropriate add-post-event-callback. For #118.
I don't think that re-frame could cause re-frame uses alternative async functions here: |
Yes, the timeout is pausing execution for that period of time, but no events are being processed. After my go-loop is done, then all events are processed (and callbacks called) |
@pupeno I have prepared version v0.6.0 for release (currently sitting in the develop branch). When you have satisfied yourself that the new API ticks the boxes, ping me and we'll officially release this version. |
I just released Prerenderer 0.2.0 using the new API: https://carouselapps.com/2015/12/13/prerenderer-0-2-0-released/ Feel free to close this issue whenever you want. I'm satisfied with the current state. Thank you @mike-thompson-day8 |
Great news. Thanks @pupeno. |
The goal of this is to implement prerendering that needs visibility into what's going on in re-frame. I created a library called com.carouselapps/prerenderer that uses this feature. You can learn more about it here: https://carouselapps.com/prerenderer/