-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Looks like rending same compiled template many times simultaneously fires errors like V8::Error: Maximum call stack size exceeded or worse, gets the process stuck.
Is there a better practice for that?
I don't want to lose the speed of compiled templates.
The rendering is running under Sidekiq process which gets stuck often.
require 'celluloid'
handlebars = Handlebars::Context.new
tpl = handlebars.compile(...)
# works fine
10.times { 20.times.map { |i| Celluloid::Future.new { puts "start #{i}"; sleep 0.1; puts "end #{i}" } }.each(&:value) }
# process will hang forever at some point
10.times { 20.times.map { |i| Celluloid::Future.new { puts "start #{i}"; tpl.call(data: data); puts "end #{i}" } }.each(&:value) }
Metadata
Metadata
Assignees
Labels
No labels