gevent


Replace gevent.spawn_link_exception


This old code makes a call to gevent.spawn_link_exception which no longer exists:
def start(self, checkpoint=None):
for gl in self._greenlets:
gl.kill()
self.load_config()
self._greenlets = [
gevent.spawn_link_exception(self.periodic_checkpoint, 5) ]
for master_uri in self._config:
self._greenlets.append(
gevent.spawn_link_exception(
self.replicate, master_uri, checkpoint))
Please help me to update this code so that it works with the latest version of gevent. Thanks.
You can approach the same thing via Greenlet.link_exception method. Here is your modified example:
def start(self, checkpoint=None):
for gl in self._greenlets:
gl.kill()
self.load_config()
def exception_callback(greenlet):
print "Exception happened in ", greenlet
self._greenlets = [gevent.spawn(self.periodic_checkpoint, 5)]
self._greenlets[-1].link_exception(exception_callback)
for master_uri in self._config:
self._greenlets.append(gevent.spawn(self.replicate, master_uri, checkpoint))
self._greenlets[-1].link_exception(exception_callback)

Related Links

building gevent in raspberry pi qemu
Some confusion about gevent (cffi) setup
Do rdflib and gevent work nicely together?
Replace gevent.spawn_link_exception
thread exception occurred in gevent
Is join required on gevent gthreads?
ZeroRPC heartbeats and timeouts
NewRelic doesn't graph any data in a Python + Gevent based system
Is there any way to run gevent-socketio 0.3.5-rc2 with gunicorn 18.0 without downgrading
How can I test to see whether gevent monkey patching is active?
How does gevent interact with threading.local data?
werkzeug server failed to handle request
Running time puzzle about gevent
Why does this http streaming not work as expected?

Categories

HOME
youtube-api
javafx
ide
virtual-machine
livecharts
swap
osx-yosemite
restheart
token
ejb-3.0
apache-httpclient-4.x
dynamics-crm-2011
email-attachments
watson-dialog
saucelabs
bug-reporting
connection-pooling
email-client
apdu
core-animation
oracle10g
tftp
custom-fields
cqlsh
ocl
restler
n1ql
cocoa-scripting
azure-vm-scale-set
kdevelop
scalamock
mybatis-generator
armadillo
ng-lightning
server-side-swift
aspnetboilerplate
ack
easyquery
playframework-1.x
ajv
liferay-ide
try-catch-finally
critical-section
rmq
qt3d
mac-app-store
avi
mrunit
window.location
instabug
ios8-share-extension
webservices-client
personality-insights
log4cxx
jsoncpp
properties-file
autoscaling
radgrid
chrome-mobile
mri
qxorm
fiware-health
drools-guvnor
uiblureffect
fxmlloader
formbuilder
parsefloat
powershell-v1.0
dayofweek
git-subtree
grape-api
tlbimp
caroufredsel
qmainwindow
cocotron
rbm
boost.build
antixsslibrary
derived-class
custom-cursor
mvcmailer
pinchzoom
towerjs
session-hijacking
gmagick
onunload
nyromodal
linq-to-mysql
numerical-computing
mdd
file-storage
bootstrap-protocol
content-delivery-network
software-update

Resources

Encrypt Message