set_attr
Applicable Products
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
Function Description
Sets the attributes of FlowNode.
Prototype
1 | set_attr(attr_name, attr_value) |
Parameters
Parameter |
Data Type |
Value 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
Setting depth and policy via _flow_attr_depth and _flow_attr_enqueue_policy takes no effect unless _flow_attr is enabled in advance.
Parent topic: dataflow.FlowNode