Revision cf7b0cc4

b/lib/confd/client.py
21 21

  
22 22
"""Ganeti confd client
23 23

  
24
Clients can use the confd client library to send requests to a group of master
25
candidates running confd. The expected usage is through the asyncore framework,
26
by sending queries, and asynchronously receiving replies through a callback.
27

  
28
This way the client library doesn't ever need to "wait" on a particular answer,
29
and can proceed even if some udp packets are lost. It's up to the user to
30
reschedule queries if they haven't received responses and they need them.
31

  
32
Example usage:
33
  client = ConfdClient(...) # includes callback specification
34
  req = confd_client.ConfdClientRequest(type=constants.CONFD_REQ_PING)
35
  client.SendRequest(req)
36
  # then make sure your client calls asyncore.loop() or daemon.Mainloop.Run()
37
  # ... wait ...
38
  # And your callback will be called by asyncore, when your query gets a
39
  # response, or when it expires.
40

  
24 41
"""
25 42
import socket
26 43
import time

Also available in: Unified diff