Пример #1
0
def handle_incoming_request(request):
    client_id = "python-sdk-cookbook-rpc-commands-client-receiver"
    if request:
        print(
            "Subscriber Received request: Metadata:'%s', Channel:'%s', Body:'%s' tags:%s"
            % (request.metadata, request.channel, request.body, request.tags))
        response = Response(request)
        response.body = "OK".encode('UTF-8')
        response.cache_hit = False
        response.error = "None"
        response.client_id = client_id
        response.executed = True
        response.metadata = "OK"
        response.timestamp = datetime.datetime.now()
        return response
def handle_incoming_request(request):
    if request:
        print(
            "Subscriber Received request: Metadata:'%s', Channel:'%s', Body:'%s' tags:%s"
            % (request.metadata, request.channel, request.body, request.tags))

        response = Response(request)
        response.body = "OK".encode('UTF-8')
        response.cache_hit = False
        response.error = "None"
        response.client_id = 'hello-world-sender'
        response.executed = True
        response.metadata = "OK"
        response.timestamp = datetime.datetime.now()
        response.tags = request.tags
        return response