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

async view rendering #40

Open
aaronjensen opened this issue May 15, 2013 · 4 comments
Open

async view rendering #40

aaronjensen opened this issue May 15, 2013 · 4 comments
Milestone

Comments

@aaronjensen
Copy link
Contributor

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?

@chrismccord
Copy link
Owner

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.

@chrismccord
Copy link
Owner

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).

@aaronjensen
Copy link
Contributor Author

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.

@ajb
Copy link
Collaborator

ajb commented Dec 22, 2014

Maybe https://github.com/tra/spawnling?

I'd be more than happy to review a PR for this feature.

@ajb ajb modified the milestone: 2.0 Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants