-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add immediate return result (#254)
- Loading branch information
Showing
30 changed files
with
606 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
core/include_internal/ten_runtime/msg/cmd_base/cmd_result/field/is_completed.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// | ||
#pragma once | ||
|
||
#include "ten_runtime/ten_config.h" | ||
|
||
#include <stdbool.h> | ||
|
||
#include "include_internal/ten_runtime/msg/loop_fields.h" | ||
#include "ten_utils/container/list.h" | ||
|
||
typedef struct ten_msg_t ten_msg_t; | ||
typedef struct ten_http_t ten_http_t; | ||
typedef struct ten_error_t ten_error_t; | ||
|
||
TEN_RUNTIME_PRIVATE_API void ten_cmd_result_copy_is_completed( | ||
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids); | ||
|
||
TEN_RUNTIME_PRIVATE_API bool ten_cmd_result_process_is_completed( | ||
ten_msg_t *self, ten_raw_msg_process_one_field_func_t cb, void *user_data, | ||
ten_error_t *err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
core/include_internal/ten_runtime/path/result_return_policy.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// | ||
#pragma once | ||
|
||
#include "ten_runtime/ten_config.h" | ||
|
||
#define TEN_DEFAULT_RESULT_RETURN_POLICY \ | ||
TEN_RESULT_RETURN_POLICY_FIRST_ERROR_OR_LAST_OK | ||
|
||
typedef enum TEN_RESULT_RETURN_POLICY { | ||
TEN_RESULT_RETURN_POLICY_INVALID, | ||
|
||
// If receive a fail result, return it, otherwise, when all OK results are | ||
// received, return the first received one. Clear the group after returning | ||
// the result. | ||
TEN_RESULT_RETURN_POLICY_FIRST_ERROR_OR_FIRST_OK, | ||
|
||
// Similar to the above, except return the last received one. | ||
TEN_RESULT_RETURN_POLICY_FIRST_ERROR_OR_LAST_OK, | ||
|
||
// Return each result immediately as it is received. | ||
TEN_RESULT_RETURN_POLICY_EACH_IMMEDIATELY, | ||
|
||
// More modes is allowed, and could be added here in case needed. | ||
} TEN_RESULT_RETURN_POLICY; | ||
|
||
TEN_RUNTIME_PRIVATE_API TEN_RESULT_RETURN_POLICY | ||
ten_result_return_policy_from_string(const char *policy_str); | ||
|
||
TEN_RUNTIME_PRIVATE_API const char *ten_result_return_policy_to_string( | ||
TEN_RESULT_RETURN_POLICY policy); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.