Example #1
0
class UpdateCursorTasks(TaskSet):
    hubTasks = None

    def on_start(self):
        self.hubTasks = HubTasks(UpdateCursorUser(), self.client)
        self.hubTasks.start()

    @task(1000)
    def write_read(self):
        self.hubTasks.write_read()

    @task(50)
    def verify_cursor_update(self):
        self.hubTasks.verify_cursor_update()

    @task(50)
    def verify_cursor_update_via_upsert(self):
        self.hubTasks.verify_cursor_update_via_upsert()

    @task(10)
    def get_webhook_config(self):
        self.hubTasks.get_webhook_config()

    @web.app.route("/callback", methods=['GET'])
    def get_channels(self):
        return HubTasks.get_channels()

    @web.app.route("/callback/<channel>", methods=['GET', 'POST'])
    def callback(channel):
        return HubTasks.callback(channel)
Example #2
0
class UpdateCursorTasks(TaskSet):
    hubTasks = None

    def on_start(self):
        self.hubTasks = HubTasks(UpdateCursorUser(), self.client)
        self.hubTasks.start()

    @task(1000)
    def write_read(self):
        self.hubTasks.write_read()

    @task(50)
    def verify_cursor_update(self):
        self.hubTasks.verify_cursor_update()

    @task(50)
    def verify_cursor_update_via_upsert(self):
        self.hubTasks.verify_cursor_update_via_upsert()

    @task(10)
    def get_webhook_config(self):
        self.hubTasks.get_webhook_config()

    @web.app.route("/callback", methods=['GET'])
    def get_channels(self):
        logger.debug(
            utils.get_client_address(request) + ' | ' + request.method +
            ' | /callback')
        return HubTasks.get_channels()

    @web.app.route("/callback/<channel>", methods=['GET', 'POST'])
    def callback(channel):
        logger.debug(
            utils.get_client_address(request) + ' | ' + request.method +
            ' | /callback/' + channel + ' | ' + request.get_data().strip())
        return HubTasks.callback(channel)

    @web.app.route('/store/<name>', methods=['GET'])
    def get_store(name):
        return Response(HubTasks.get_store(name), mimetype='application/json')