-
Notifications
You must be signed in to change notification settings - Fork 106
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
async view rendering #40
Comments
Async rendering is definitely something I would like to support in the gem. The reason I left it out is concerns over ActiveRecord thread safety with rending in a new thread. I haven't done any digging to see what it would take to support, but I would greatly prefer async rendering in process to sidekiq/resque/dj since there is quite a bit of latency between queuing the job and it being processed, not to mention yet another dependent process. If you have any insights into what it would take to get this in place let me know. |
I'll also note that async rendering requiring a generic context would be fine. The more I think about it, the more I think you're right about a generic context by default being the way to go, with an alternative using the controller's context when desired (vs using the controller context as default now). |
I can't comment on thread safety issues... I am curious too about running things in process async because I don't fully understand the lifecycle of processes in various application servers. I'd be afraid of things dying midstream, but I have no idea if that's a justified fear. About the generic context, that sounds good. I was going to dig into modifying my project to force the generic context, but maybe I'll hold off for now. |
Maybe https://github.com/tra/spawnling? I'd be more than happy to review a PR for this feature. |
view rendering itself is pretty slow, so while doing the request to pusher async is helpful, it would be ideal if we could do all view rendering async. Obviously this would require us to use the generic context rather than the controller's context but I'm A-OK with that.
Is this something you'd want to support in the gem or would it just make sense to encourage people to sidekiq/resque/delayed_job the syncs?
The text was updated successfully, but these errors were encountered: