def emit(self, key, value):
if self.__spilling:<EOL><INDENT>self.__actual_emit(key, value)<EOL><DEDENT>else:<EOL><INDENT>self.__cache.setdefault(key, []).append(value)<EOL>self.__cache_size += sizeof(key) + sizeof(value)<EOL>if self.__cache_size >= self.__spill_size:<EOL><INDENT>self.__spill_all()<EOL><DEDENT><DEDENT>self.progress()<EOL>
\
        Handle an output key/value pair.

        Reporting progress is strictly necessary only when using a Python
        record writer, because sending an output key/value pair is an implicit
        progress report. To take advantage of this, however, we would be
        forced to flush the uplink stream at every output, and that would be
        too costly. Rather than add a specific timer for this, we just call
        progress unconditionally and piggyback on its timer instead. Note that
        when a combiner is caching there is no actual output, so in that case
        we would need an explicit progress report anyway.