Exemple #1
0
def watch_once(flux_handle, key):
    """ Watches the selected key until the next change, then returns the updated value of the key """
    if isdir(flux_handle, key):
        d = get_dir(flux_handle)
        # The wrapper automatically unpacks d's handle
        _raw.watch_once_dir(flux_handle, d)
        return d
    else:
        j = json_c.Jobj()
        _raw.watch_once(flux_handle, key, j.get_as_dptr())
        return j.as_str()
Exemple #2
0
def put(flux_handle, key, value):
    j = json_c.Jobj(json.dumps(value))
    _raw.put_obj(flux_handle, key, j.get())
Exemple #3
0
def get_key_direct(flux_handle, key):
    j = json_c.Jobj()
    _raw.get_obj(flux_handle, key, j.get_as_dptr())
    return json.loads(j.as_str())
Exemple #4
0
 def watch_once(self, flux_handle, key):
     """ Watches the selected key until the next change, then returns the updated value of the key """
     j = json_c.Jobj()
     self.pimpl.kvs_watch_once_dir(self.fh, self.handle, j.get_as_dptr())
     return j.as_str()
Exemple #5
0
 def __setitem__(self, key, value):
     # Turn it into json
     j = json_c.Jobj(json.dumps(value))
     self.pimpl.put_obj(key, j.get())