def publish(self, msg, exchange, routing_key, mandatory=False,
                immediate=False, ticket=None):
        args = Writer()
        args.write_short(ticket or self.default_ticket).\
            write_shortstr(exchange).\
            write_shortstr(routing_key).\
            write_bits(mandatory, immediate)

        self.send_frame(MethodFrame(self.channel_id, 60, 40, args))
        self.send_frame(
            HeaderFrame(self.channel_id, 60, 0, len(msg), msg.properties))

        f_max = self.channel.connection.frame_max
        for f in ContentFrame.create_frames(self.channel_id, msg.body, f_max):
            self.send_frame(f)
If C{preserve_context} is run outside an action context it just
dataset/ETHPy150Open agoragames/haigha/haigha/classes/basic_class.py/BasicClass.publish--crossover with--dataset/ETHPy150Open ClusterHQ/eliot/eliot/tests/test_action.py/PreserveContextTests.test_no_context