get_user_data
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
Function Description
Obtains user information.
Prototype
1 | get_user_data(self, size: int = 0, offset: int = 0) -> bytearray |
Parameters
Parameter |
Data Type |
Description |
|---|---|---|
size |
int |
Length of the user data. Value range: [0, 64] |
offset |
int |
Offset of the user data, which must comply with the following restriction: [0, 64), size+offset<=64 |
Returns
bytearray is returned in normal scenarios.
The dataflow.DfException exception is reported in abnormal scenarios. For details, see DataFlow Error Codes.
Examples
1 2 3 4 5 6 7 8 | import dataflow as df graph = df.FlowGraph(...) user_data_str = "UserData123" result = graph.fetch_data () # Fetch the result asynchronously. flowinfo = result[1] fetch_user_data = flowinfo.get_user_data(len(user_data_str)) name = fetch_user_data.decode('utf-8') print(name) |
Constraints
None
Parent topic: dataflow.FlowInfo