parameters: (self, channel, message_type, handler)
docstring: Subscribes the handler to the given channel, using message_type to
          pass in a decoded message object (not the raw bytes). The handler will
          only be called at some maximum frequency. Messages on the same channel
          that arrive too quickly will be discarded.
docstring_summary: Subscribes the handler to the given channel, using message_type to
          pass in a decoded message object (not the raw bytes). The handler will
          only be called at some maximum frequency. Messages on the same channel
          that arrive too quickly will be discarded.
docstring_tokens: Subscribes the handler to the given channel using message_type to pass in a decoded message object ( not the raw bytes ) . The handler will only be called at some maximum frequency . Messages on the same channel that arrive too quickly will be discarded .
function: def _subscribe(self, channel, message_type, handler):
          """Subscribes the handler to the given channel, using message_type to
          pass in a decoded message object (not the raw bytes). The handler will
          only be called at some maximum frequency. Messages on the same channel
          that arrive too quickly will be discarded.
          """
          # Record this channel's type and handler.
          assert self._message_types.get(channel, message_type) == message_type
          self._message_types[channel] = message_type
          self._message_handlers.setdefault(channel, []).append(handler)
  
          # Subscribe using an internal function that implements "last one wins".
          # It's important to service the LCM queue as frequently as possible:
          #  https://github.com/RobotLocomotion/drake/issues/15234
          #  https://github.com/lcm-proj/lcm/issues/345
          # However, if the sender is transmitting visualization messages at
          # a high rate (e.g., if a sim is running much faster than realtime),
          # then we should only pass some of them along to MeshCat to avoid
          # flooding it. The hander merely records the message data; we'll
          # pass it along to MeshCat using our `self._should_update()` timer.
          def _on_message(data):
              self._message_pending_data[channel] = data
          self._lcm.Subscribe(channel=channel, handler=_on_message)
function_tokens: def _subscribe ( self , channel , message_type , handler ) : # Record this channel's type and handler. assert self . _message_types . get ( channel , message_type ) == message_type self . _message_types [ channel ] = message_type self . _message_handlers . setdefault ( channel , [ ] ) . append ( handler ) # Subscribe using an internal function that implements "last one wins". # It's important to service the LCM queue as frequently as possible: #  https://github.com/RobotLocomotion/drake/issues/15234 #  https://github.com/lcm-proj/lcm/issues/345 # However, if the sender is transmitting visualization messages at # a high rate (e.g., if a sim is running much faster than realtime), # then we should only pass some of them along to MeshCat to avoid # flooding it. The hander merely records the message data; we'll # pass it along to MeshCat using our `self._should_update()` timer. def _on_message ( data ) : self . _message_pending_data [ channel ] = data self . _lcm . Subscribe ( channel = channel , handler = _on_message )