# query_management module

Copyright (c) 2017 beyond-blockchain.org.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

> http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

`Ticker`([tick_interval]) | Clock ticker for query timers
`QueryEntry`([expire_after, callback_expire, …]) | Querying entry

class `query_management.``QueryEntry`(expire_after=30, callback_expire=None, callback=None, callback_error=None, interval=0, data={}, retry_count=-1)

  Bases: `object`

  Querying entry

  `callback`()

    Call a callback function for successful case

    Returns: |

  `callback_error`()

    Call a callback function for failure case

    Returns: |

  `deactivate`()

    Deactivate the entry

    Returns: |

  `fire`()

    Fire the entry

    Returns: |

  `force_expire`()

    Forcibly make the entry expire

    Returns: |

  `rest_of_time_to_expire`()

    Get the rest of time to expire :return:

  `update`(fire_after=None, callback=None, callback_error=None)

    Update the entry information

    Parameters: | fire_after – callback – callback_error –
    Returns: |

  `update_expiration_time`(expire_after)

    Update the expire timer

    Parameters: | expire_after –
    Returns: |

class `query_management.``Ticker`(tick_interval=0.049)

  Bases: `object`

  Clock ticker for query timers

  `add_entry`(entry)
  `del_entry`(nonce)
  `get_entry`(nonce)
  `refresh_timer`()
  `tick_loop`()
  `update_timer`(nonce, append_new_flag)

`query_management.``exec_func_after`(func, after)

  Simple timer utility to call function after specified time (second)

  Parameters: | func – after –
  Returns: |

`query_management.``get_ticker`(tick_interval=0.049)