AsyncTraversalStrategies.apply_strategies()   A
last analyzed

Complexity

Conditions 3

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 3
nop 2
1
import asyncio
2
3
from gremlin_python.process import traversal
4
5
6
class AsyncTraversalStrategies(traversal.TraversalStrategies):
7
8
    async def apply_strategies(self, traversal):
9
        for traversal_strategy in self.traversal_strategies:
10
            func = traversal_strategy.apply(traversal)
11
            if asyncio.iscoroutine(func):
12
                await func
13