Re: Error "signal only works in main thread"

Joel Rivera <[email protected]>
Newsgroups gmane.comp.python.cherrypy
Message-ID <20160311122225.4a70f1b2@graphene>
Create a plugin and publish channels to call the pyomo methods from
the main thread, more specifically methods that uses the calls to
pyomo. If the problem is limited to `SolverFactory("glpk").solve(m)`
then you can just publish a channel to do:

   result = cherrypy.engine.publish('solve', 'glpk', m).pop()

The plugins execute at the `cherrypy.engine` level which is the
Main-Thread.

For more information about the plugins/server-wide functions:

http://docs.cherrypy.org/en/latest/extend.html#server-wide-functions

Regards

On Fri, 11 Mar 2016 04:49:29 -0800 (PST)
stm <[email protected]> wrote:

> Hi,
> 
> I'd like to create a simple web API using Cherrypy that can be used
> to solve some optimization problem using Pyomo (pyomo.org).
> 
> When Pyomo's solve method is called I get the error "signal only
> works in main thread".
> 
> What can I do to make this work? Is it possible to make Cherrypy run
> on the main thread? (I know it'd be slower, but don't mind)
> 
> Here's a minimal example to reproduce the problem:
> 
> https://gist.github.com/anonymous/ea94c3c45bbcb71a6850
> Thanks!
> 

-- 
Rivera²

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.