diff options
| author | anonimal <anonimal@i2pmail.org> | 2017-06-28 21:07:24 +0000 |
|---|---|---|
| committer | anonimal <anonimal@i2pmail.org> | 2018-03-18 15:52:19 +0000 |
| commit | 84c5a9ba481d7a33cc0fd0ca43867b61d127d907 (patch) | |
| tree | f05d3d3f107da02005b4a61f0e5074c113a7165c /external/unbound/libunbound/python/doc/examples/example3.rst | |
| parent | a14eabc0437c01ae9245bd9ba1641d96b889306a (diff) | |
| download | monzero-core-84c5a9ba481d7a33cc0fd0ca43867b61d127d907.tar.gz monzero-core-84c5a9ba481d7a33cc0fd0ca43867b61d127d907.tar.xz monzero-core-84c5a9ba481d7a33cc0fd0ca43867b61d127d907.zip | |
Unbound: remove unbound from in-tree source
We'll instead use a git submodule to pull from our unbound repo.
Diffstat (limited to 'external/unbound/libunbound/python/doc/examples/example3.rst')
| -rw-r--r-- | external/unbound/libunbound/python/doc/examples/example3.rst | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/external/unbound/libunbound/python/doc/examples/example3.rst b/external/unbound/libunbound/python/doc/examples/example3.rst deleted file mode 100644 index b0626b55f..000000000 --- a/external/unbound/libunbound/python/doc/examples/example3.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. _example_asynch: - -Asynchronous lookup -=================== - -This example performs the name lookup in the background. -The main program keeps running while the name is resolved. - -Source code ------------ - -:: - - #!/usr/bin/python - import time - import unbound - - ctx = unbound.ub_ctx() - ctx.resolvconf("/etc/resolv.conf") - - def call_back(my_data,status,result): - print "Call_back:", my_data - if status == 0 and result.havedata: - print "Result:", result.data.address_list - my_data['done_flag'] = True - - - my_data = {'done_flag':False,'arbitrary':"object"} - status, async_id = ctx.resolve_async("www.seznam.cz", my_data, call_back, unbound.RR_TYPE_A, unbound.RR_CLASS_IN) - - while (status == 0) and (not my_data['done_flag']): - status = ctx.process() - time.sleep(0.1) - - if (status != 0): - print "Resolve error:", unbound.ub_strerror(status) - -The :meth:`unbound.ub_ctx.resolve_async` method is able to pass on any Python -object. In this example, we used a dictionary object ``my_data``. |
