set_attr
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
Function Description
Sets the attributes of FlowNode.
Prototype
1 | set_attr(attr_name, attr_value) |
Parameters
Parameter |
Data Type |
Description |
|---|---|---|
attr_name |
str |
Attribute name. Currently, the following types are supported:
|
attr_value |
Union[bool, str, int] |
Attribute value. |
Returns
None is returned in normal scenarios.
TypeError is returned when the parameter type is incorrect.
Examples
1 2 3 4 5 6 | import dataflow as df pp = df.FuncProcessPoint(...) flow_node = df.FlowNode(...) flow_node.set_attr("_flow_attr",True) flow_node.set_attr("_flow_attr_depth",5) flow_node.set_attr("_flow_attr_enqueue_policy","FIFO") |
Constraints
Before setting the depth and policy by using _flow_attr_depth and _flow_attr_enqueue_policy, you need to enable _flow_attr. Otherwise, the settings do not take effect.
Parent topic: dataflow.FlowNode