Part of lp.codehosting.puller.scheduler View In Hierarchy
The wire protocol for receiving events from the puller worker. The wire-level protocol is a series of netstrings. At the next level up, the protocol consists of messages which each look like this:: [method-name] [number-of-arguments] [arguments]+ Thus the instance is always in one of three states::  Waiting for command name.  Waiting for argument count.  Waiting for an argument. In state , we are waiting for a command name. When we get one, we store it in self._current_command and move into state . In state , we are waiting for an argument count. When we receive a message, we try to convert it to an integer. If we fail in this, we call unexpectedError(). Otherwise, if it's greater than zero, we store the number in self._expected_args and go into state  or if it's zero execute the command (see below). In state , we are waiting for an argument. When we receive one, we append it to self._current_args. If len(self._current_args) == self._expected_args, execute the command. "Executing the command" means looking for a method called do_<command name> on self.puller_protocol and calling it with *self._current_args. If this raises, call self.puller_protocol.unexpectedError(). The method _resetState() forces us back into state .
|Method||_resetState||Force into the 'waiting for command' state.|