feat(mq): add mq_runtime_defer, default disable

This commit is contained in:
yangwei
2024-10-18 14:04:19 +08:00
parent 65ae531ee3
commit 722ae7483b
5 changed files with 41 additions and 17 deletions

View File

@@ -161,7 +161,7 @@ void test_pub_and_clean_on_msg(int topic_id, void *msg, void *sub_arg)
return;
}
TEST(mq_runtime, pub_then_clean) {
TEST(mq_runtime, defer_pub_then_clean) {
struct test_pub_and_clean_env env={};
env.s = mq_schema_new();
@@ -174,6 +174,8 @@ TEST(mq_runtime, pub_then_clean) {
env.rt=mq_runtime_new(env.s);
EXPECT_TRUE(env.rt!=NULL);
mq_runtime_defer(env.rt);
for(int i=0; i<env.N_round;i++)
{
env.current_round=i;
@@ -370,6 +372,7 @@ TEST(mq_runtime, pub_on_msg_free)
env.N_round=10;
env.rt=mq_runtime_new(env.s);
EXPECT_TRUE(env.rt!=NULL);
mq_runtime_defer(env.rt);
for(int i=0; i<env.N_round;i++)
{
env.current_round=i;