This document describes how to use Transfer, Response, and Context blocks.
Index
Plan Control
•
The access rights to Operator > Async Block are controlled by your subcribe plan.
•
If you use an Async Block that does not include a fee, a caution message will appear when saving. (There are unavailable blocks included. Please check and try again.)
Free | Starter | Plus | Pro | Enterprise | |
Protocol
- Async | - | - | - | ✓ | ✓ |
Transfer Blockset
•
Transfer blocksets are used by servers (services) to request data requests and commands through specific Protocols or to process responses.
Function | Explanation |
ID | The unique ID of the Transfer blockset is automatically created when the block is registered. |
protocol unit | Enter the protocol blockset of the API to be called. |
contexts | Define the response object to be received after executing the API as a Response Context block. |
Async
•
This is an Adapter Block for Async processing.
•
SyncTree is based on the ‘synchronous processing’ method, which is performed step by step from the top.
•
Asynchronous processing allows you to efficiently utilize resources to complete requests faster.
Synchronous | Asynchronous |
- Do one task at a time.
- The order of execution is clear, so it is easy to predict the flow. | - Fast processing speed by performing multiple tasks at the same time.
- It is difficult to predict flow or debug because it cannot be guaranteed which will be completed first. |
1) Async Task
•
This is a block that performs Async prcessing.
•
Does not wait for a response after requesting an action.
•
You can use the variables of the called BizUnit as Async Task arguments by connecting the Create Set - Async Argument block to the Arguments socket.
•
Async Task Example
No. | Description |
1 | Create global variable globalVariable and add value (foreground) |
2 | Async Task blockset |
2-1 | Use globalVariable as an Async Task argument with the Create Set Async Arguments block. |
2-2 | Async Task execution 10 second delay block |
2-3 | Change value of globalVariable (background) |
3 | After requesting an Async Task, no response result is received.
- 10 second delay not performed
- Variable value does not change |
2) Await Task
•
This is a block that waits for a response until the async logic is processed.
3) Task Return
•
Specify the return value to be passed to the original BizUnit after performing Async with the Task Return block.
•
Async/Await Task Example
No. | Description |
1 | Create global variable globalVariable and add value (foreground) |
2 | Async Task blockset |
2-1 | Use globalVariable as an Async Task argument with the Create Set Async Arguments block. |
2-2 | Async Task execution 10 second delay block |
2-3 | Change value of globalVariable (background) |
2-4 | Specify return value to be delivered to the original BizUnit after Async execution with Task Return block |
3 | Execute Await Task block set |
3-1 | Enter the Transfer ID of the Async block set to perform the Await Task. |
3-2 | Specifies which variable of the original BizUnit to register the value returned by Task Return. |
4 | Receive the response result after requesting the Async Task.
- 10 second delay execution
- Variable value changed |
Response Blockset
•
The Response block is used to handle API responses.
Function | Explanation |
ID | The unique ID of the Response blockset is automatically created when the block is registered. |
contexts | Define the response object to be received after executing the API as a Response Context block. |
Context
•
The Response Context blockset defines the response objects to be received after executing the API.
Function | Explanation |
status code | Enter the Http status code as an integer. There are nulls and 200 as presets. |
header | Header area of data to be responded. |
body | Body area of data to be responded. |