bbc1.core.query_management module

Copyright (c) 2017

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

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.

class bbc1.core.query_management.QueryEntry(expire_after=30, callback_expire=None, callback=None, callback_error=None, interval=0, data={}, retry_count=-1)[source]

Bases: object

Callback manager


Call a callback function for successful case


Call a callback function for failure case


Deactivate the entry

update(fire_after=None, expire_after=None, callback=None, callback_error=None, init=False)[source]

Update the entry information

  • fire_after (float) – set callback (periodical) to fire after given time (in second)
  • expire_after (float) – set expiration timer to given time (in second)
  • callback (obj) – callback method that will be called periodically
  • callback_error (obj) – callback method that will be called when error happens
  • init (bool) – If True, the scheduler is sorted again

Update the expire timer

Parameters:expire_after (float) – new expiration time in second
class bbc1.core.query_management.Ticker(tick_interval=0.049)[source]

Bases: object

Clock ticker for query timers


Delete an entry from the scheduler identified by nonce


Get an entry identified by nonce