Skip to content

Commit

Permalink
docs: Add arg docs for afork()
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Jan 11, 2021
1 parent 634fd18 commit a98ae22
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/aiotools/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ async def afork(child_func: Callable[[], int]) -> AbstractChildProcess:
Fork the current process and execute the given function in the child.
The return value of the function will become the exit code of the child
process.
Args:
child_func: A function that represents the main function of the child and
returns an integer as its exit code.
Note that the function must set up a new event loop if it
wants to run asyncio codes.
"""
if _has_pidfd:
pid, pidfd = await _clone_pidfd(child_func)
Expand Down

0 comments on commit a98ae22

Please sign in to comment.