Skip to content

ProcessManagerProtocol

Sub classes

Name Children Inherits
ProcessManager
anyenv.process_manager.process_manager
Manages background processes for an agent pool.

    Base classes

    Name Children Inherits
    Protocol
    typing
    Base class for protocol classes.

    â‹” Inheritance diagram

    graph TD
      4098741074["protocol.ProcessManagerProtocol"]
      1073422405["typing.Protocol"]
      3481597255["typing.Generic"]
      2751680898["builtins.object"]
      1073422405 --> 4098741074
      3481597255 --> 1073422405
      2751680898 --> 3481597255

    🛈 DocStrings

    Bases: Protocol

    Protocol for managing background processes.

    Source code in src/anyenv/process_manager/protocol.py
    class ProcessManagerProtocol(Protocol):
        """Protocol for managing background processes."""
    
        async def start_process(
            self,
            command: str,
            args: list[str] | None = None,
            cwd: str | Path | None = None,
            env: dict[str, str] | None = None,
            output_limit: int | None = None,
        ) -> str:
            """Start a background process.
    
            Returns:
                Process ID for tracking
            """
            ...
    
        async def get_output(self, process_id: str) -> ProcessOutput:
            """Get current output from a process.
    
            Returns:
                Current process output
            """
            ...
    
        async def wait_for_exit(self, process_id: str) -> int:
            """Wait for process to complete.
    
            Returns:
                Exit code
            """
            ...
    
        async def kill_process(self, process_id: str) -> None:
            """Kill a running process."""
            ...
    
        async def release_process(self, process_id: str) -> None:
            """Release process resources."""
            ...
    
        async def list_processes(self) -> list[str]:
            """List all running processes."""
            ...
    
        async def get_process_info(self, process_id: str) -> dict[str, Any]:
            """Get information about a process.
    
            Returns:
                Process information
            """
            ...
    

    get_output async

    get_output(process_id: str) -> ProcessOutput
    

    Get current output from a process.

    Returns:

    Type Description
    ProcessOutput

    Current process output

    Source code in src/anyenv/process_manager/protocol.py
    async def get_output(self, process_id: str) -> ProcessOutput:
        """Get current output from a process.
    
        Returns:
            Current process output
        """
        ...
    

    get_process_info async

    get_process_info(process_id: str) -> dict[str, Any]
    

    Get information about a process.

    Returns:

    Type Description
    dict[str, Any]

    Process information

    Source code in src/anyenv/process_manager/protocol.py
    async def get_process_info(self, process_id: str) -> dict[str, Any]:
        """Get information about a process.
    
        Returns:
            Process information
        """
        ...
    

    kill_process async

    kill_process(process_id: str) -> None
    

    Kill a running process.

    Source code in src/anyenv/process_manager/protocol.py
    async def kill_process(self, process_id: str) -> None:
        """Kill a running process."""
        ...
    

    list_processes async

    list_processes() -> list[str]
    

    List all running processes.

    Source code in src/anyenv/process_manager/protocol.py
    async def list_processes(self) -> list[str]:
        """List all running processes."""
        ...
    

    release_process async

    release_process(process_id: str) -> None
    

    Release process resources.

    Source code in src/anyenv/process_manager/protocol.py
    async def release_process(self, process_id: str) -> None:
        """Release process resources."""
        ...
    

    start_process async

    start_process(
        command: str,
        args: list[str] | None = None,
        cwd: str | Path | None = None,
        env: dict[str, str] | None = None,
        output_limit: int | None = None,
    ) -> str
    

    Start a background process.

    Returns:

    Type Description
    str

    Process ID for tracking

    Source code in src/anyenv/process_manager/protocol.py
    async def start_process(
        self,
        command: str,
        args: list[str] | None = None,
        cwd: str | Path | None = None,
        env: dict[str, str] | None = None,
        output_limit: int | None = None,
    ) -> str:
        """Start a background process.
    
        Returns:
            Process ID for tracking
        """
        ...
    

    wait_for_exit async

    wait_for_exit(process_id: str) -> int
    

    Wait for process to complete.

    Returns:

    Type Description
    int

    Exit code

    Source code in src/anyenv/process_manager/protocol.py
    async def wait_for_exit(self, process_id: str) -> int:
        """Wait for process to complete.
    
        Returns:
            Exit code
        """
        ...
    

    :fa-brands-github: Show source on GitHub