sync append entries (sync-io)
This commit is contained in:
parent
09e2f36ddd
commit
a69330b68d
|
@ -50,6 +50,7 @@ typedef struct SSyncIO {
|
||||||
void *pSyncNode;
|
void *pSyncNode;
|
||||||
int32_t (*FpOnSyncPing)(SSyncNode *pSyncNode, SyncPing *pMsg);
|
int32_t (*FpOnSyncPing)(SSyncNode *pSyncNode, SyncPing *pMsg);
|
||||||
int32_t (*FpOnSyncPingReply)(SSyncNode *pSyncNode, SyncPingReply *pMsg);
|
int32_t (*FpOnSyncPingReply)(SSyncNode *pSyncNode, SyncPingReply *pMsg);
|
||||||
|
int32_t (*FpOnSyncClientRequest)(SSyncNode *pSyncNode, SyncClientRequest *pMsg);
|
||||||
int32_t (*FpOnSyncRequestVote)(SSyncNode *pSyncNode, SyncRequestVote *pMsg);
|
int32_t (*FpOnSyncRequestVote)(SSyncNode *pSyncNode, SyncRequestVote *pMsg);
|
||||||
int32_t (*FpOnSyncRequestVoteReply)(SSyncNode *pSyncNode, SyncRequestVoteReply *pMsg);
|
int32_t (*FpOnSyncRequestVoteReply)(SSyncNode *pSyncNode, SyncRequestVoteReply *pMsg);
|
||||||
int32_t (*FpOnSyncAppendEntries)(SSyncNode *pSyncNode, SyncAppendEntries *pMsg);
|
int32_t (*FpOnSyncAppendEntries)(SSyncNode *pSyncNode, SyncAppendEntries *pMsg);
|
||||||
|
|
|
@ -273,6 +273,13 @@ static void *syncIOConsumerFunc(void *param) {
|
||||||
syncPingReplyDestroy(pSyncMsg);
|
syncPingReplyDestroy(pSyncMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (pRpcMsg->msgType == SYNC_CLIENT_REQUEST) {
|
||||||
|
if (io->FpOnSyncClientRequest != NULL) {
|
||||||
|
SyncClientRequest *pSyncMsg = syncClientRequestFromRpcMsg2(pRpcMsg);
|
||||||
|
io->FpOnSyncClientRequest(io->pSyncNode, pSyncMsg);
|
||||||
|
syncClientRequestDestroy(pSyncMsg);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (pRpcMsg->msgType == SYNC_REQUEST_VOTE) {
|
} else if (pRpcMsg->msgType == SYNC_REQUEST_VOTE) {
|
||||||
if (io->FpOnSyncRequestVote != NULL) {
|
if (io->FpOnSyncRequestVote != NULL) {
|
||||||
SyncRequestVote *pSyncMsg = syncRequestVoteFromRpcMsg2(pRpcMsg);
|
SyncRequestVote *pSyncMsg = syncRequestVoteFromRpcMsg2(pRpcMsg);
|
||||||
|
|
Loading…
Reference in New Issue