Add IN_PROGRESS return code, handle for async backends

This commit is contained in:
Tim Wojtulewicz 2025-03-09 20:48:26 -07:00
parent 60aa987e06
commit c7503654e8
6 changed files with 21 additions and 11 deletions

View file

@ -228,7 +228,7 @@ OperationResult Redis::DoOpen(RecordValPtr options, OpenResultCallback* cb) {
async_ctx->ev.addWrite = redisAddWrite;
async_ctx->ev.delWrite = redisDelWrite;
return {ReturnCode::SUCCESS};
return {ReturnCode::IN_PROGRESS};
}
/**
@ -247,8 +247,6 @@ OperationResult Redis::DoClose(OperationResultCallback* cb) {
// TODO: handle response
}
CompleteCallback(cb, {ReturnCode::SUCCESS});
redisAsyncFree(async_ctx);
async_ctx = nullptr;
@ -306,7 +304,7 @@ OperationResult Redis::DoPut(ValPtr key, ValPtr value, bool overwrite, double ex
++active_ops;
}
return {ReturnCode::SUCCESS};
return {ReturnCode::IN_PROGRESS};
}
/**
@ -329,7 +327,7 @@ OperationResult Redis::DoGet(ValPtr key, OperationResultCallback* cb) {
// There isn't a result to return here. That happens in HandleGetResult for
// async operations.
return {ReturnCode::SUCCESS};
return {ReturnCode::IN_PROGRESS};
}
/**
@ -350,7 +348,7 @@ OperationResult Redis::DoErase(ValPtr key, OperationResultCallback* cb) {
++active_ops;
return {ReturnCode::SUCCESS};
return {ReturnCode::IN_PROGRESS};
}
void Redis::DoExpire() {