This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.7 | |
# coding: utf-8 | |
import gevent | |
class TestSchedule(object): | |
def __init__(self, timeout=1, numtasks=10): | |
self.timeout = timeout | |
self.numtasks = numtasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
#coding: utf-8 | |
import gevent | |
class TestMainCo(object): | |
def __init__(self, mtimeout=2, gtimeout=3, numtasks=10): | |
self.mtimeout = mtimeout | |
self.gtimeout = gtimeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
#coding: utf-8 | |
import gevent | |
from gevent import Greenlet | |
class MyGreen(Greenlet): | |
def __init__(self, timeout, msg): | |
Greenlet.__init__(self) | |
self.timeout = timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/urs/bin/env python2.7 | |
#coding: utf-8 | |
"""Test the usage of 'gevent.event.Event' class. | |
""" | |
import random | |
import gevent | |
from gevent.event import Event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/urs/bin/env python2.7 | |
#coding: utf-8 | |
"""Test the usage of 'gevent.event.Event' class. | |
""" | |
import random | |
import gevent | |
from gevent.event import Event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
#coding: utf-8 | |
"""Test the usage of 'gevent.event.AsyncResult' | |
""" | |
import random | |
import gevent | |
from gevent.event import AsyncResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
#coding: utf-8 | |
import gevent | |
import gevent.pool | |
class TestPool(object): | |
def __init__(self, maxsize=10): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
#coding: utf-8 | |
import logging | |
import gevent | |
logging.basicConfig(level=logging.INFO) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
# -*- coding: utf-8 -*- | |
"""Implement fixed size one-dimension array and two-dimension array | |
in Python. | |
""" | |
import ctypes | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
# -*- coding: utf-8 -*- | |
""" | |
""" | |
import sys | |
import time | |
import random | |
import logging |
OlderNewer