Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
884af4c1
Commit
884af4c1
authored
Jan 10, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dns_mass_resolve.py: add comment about GEVENT_RESOLVER environ var
parent
886d2fbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
examples/dns_mass_resolve.py
examples/dns_mass_resolve.py
+7
-4
No files found.
examples/dns_mass_resolve.py
View file @
884af4c1
#!/usr/bin/python
"""Resolve hostnames concurrently, exit after 2 seconds.
Note, that gevent.socket.gethostname uses c-ares under the hood
and yields the control to other greenlets until the result is ready.
This script splits the job between a number of greenlets to get the
results faster.
Under the hood, this might use an asynchronous resolver based on
c-ares (the default) or thread-pool-based resolver.
You can choose between resolvers using GEVENT_RESOLVER environment
variable. To enable threading resolver:
GEVENT_RESOLVER=thread python dns_mass_resolve.py
"""
from
__future__
import
with_statement
import
sys
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment