'Get the exchange type instance for `exchange`.'

def typeof(self, exchange, default=u'direct'):

    try:
        type = self.state.exchanges[exchange][u'type']
    except KeyError:
        type = default
    return self.exchange_types[type]
