Пример #1
0
void get_cb(const DBID& p_key, const string& p_value, unsigned int continuation, bool success)
{
    pthread_mutex_lock(p_mutex);
    //cout << "get_cb for " << continuation << endl;
    ClientData *cd = req_client_map[continuation];
    int64_t cli_continuation = cd->getContinuation(continuation);
    cd->removeContinuation(continuation);

    // Send to client
    cd->fc->get_response(p_value, cli_continuation);

    //if (cache)
    //    cache->insert(p_key, p_value);
    //cout << "get_cb done for " << continuation << endl;
    pthread_mutex_unlock(p_mutex);
}
Пример #2
0
void put_cb(unsigned int continuation)
{
    // continuation is the server-side continuation
    // Need to map back to client continuation

    pthread_mutex_lock(p_mutex);
    //cout << "put_cb for " << continuation << endl;
    ClientData *cd = req_client_map[continuation];
    int64_t cli_continuation = cd->getContinuation(continuation);
    cd->removeContinuation(continuation);

    // Send to client
    cd->fc->put_response(cli_continuation);
    //cout << "put_cb done for " << continuation << endl;
    pthread_mutex_unlock(p_mutex);
}