what is difference from parallel option and no-wait option in pyinfra

28 views Asked by At

I wonder what is difference from parallel option and no-wait option in pyinfra.

I understand parallel option controls the number of host at once and no-wait option controls if the host operations work in parallel.

Do I misunderstand the options?

I ran the command that 'pyinfra inventory.py test_operation.py test_operation2.py'

# test_operation.py
from pyinfra.operations import python, server
import gevent
result = server.shell(
    commands=["ls"],
)

def callback():
    import time
    time.sleep(5)
    print(f"Got result: {result.stdout}")

python.call(
    name="Execute callback function",
    function=callback,
)
# test_operation2.py
from pyinfra.operations import python, server

result = server.shell(
    commands=["ls"],
)

def callback():
    import time
    time.sleep(5)
    print(f"Got result22222222: {result.stdout}")

python.call(
    name="Execute callback function",
    function=callback,
)
0

There are 0 answers