Hmm, so I just wanted to alert people that I've been having major
speed issues with this combination, embedding a OpenWfe engine inside
a small sinatra app, using Thin as the web container.

There seems to be a pause of more than 30 seconds after the calling
the Sinatra #halt method (which should immediately render the response
to the client).

My code looks something like this:

configure do
  # Do some configuration
  set :engine, engine  # <- This is a standard OpenWfe engine
instantiated by
                                  # OpenWFE::Engine.new
(application_context) earlier in the initialization process

end

post '/patients/:patient_login/evaluations' do
  workitem = OpenWFE::LaunchItem.new(PatientEvaluation)
  # .....
  # more things are added to the workitem
  #
  options.engine.launch(workitem)
  halt 201, "Evaluation created"

  # skipping exception handling
end

So, if I understand correctly, the engine should go off and do its
thing asynchronously and Sinatra should return
the 201 to the client immediately.  This is the expected behaviour,
and indeed, what I see when using Mongrel or WEBrick as the webserver.

When using Thin, although the engine returns immediately, the halt
statement seems to be involved in a timeout before it returns - it
takes at least 30 seconds.  If I add a :wait_for => true to the engine
launch, the process waits for the engine as expected, and still takes
at least 30 seconds to return.

I've tracked this down to the point in Thin's request handling cycle
where it passes off the response to EventMachine.  When it does, the
process pauses.  I haven't had time to look into this further yet, but
I thought I'd leave a message to let everyone know.
--~--~---------~--~----~------------~-------~--~----~
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to