<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def close(self) -> None: """Stop accepting new pipelinig messages and close connection when handlers done processing messages"""

        self._close = True
        if self._waiter:
            self._waiter.cancel()