#NEWLINE# def _dequeue( self ) : #NEWLINE# #INDENT# payload = self . write_queue . pop ( ) #NEWLINE# if isinstance ( payload , str ) : #NEWLINE# #INDENT# data = self . serialize ( payload ) #NEWLINE# return ( '%i%s%s' % ( len ( data ) , chr ( 0 ) , data ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( payload , tuple ) : #NEWLINE# #INDENT# return payload [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( ( 'Invalid type: %s' % type ( payload ) ) )