'Send payloads via the emitters.
:param merge_payloads: merge data and metadata payloads in a single payload and submit it
to the common endpoint
:type merge_payloads: boolean'

def emit(self, log, config, emitters, continue_running, merge_payloads=True):

    statuses = []
    def _emit_payload(payload, endpoint):
        '    Send    the    payload    via    the    emitters.    '
        statuses = []
        for emitter in emitters:
            if (not continue_running):
                return statuses
            name = emitter.__name__
            emitter_status = EmitterStatus(name)
            try:
                emitter(payload, log, config, endpoint)
            except Exception as e:
                log.exception(('Error    running    emitter:    %s' % emitter.__name__))
                emitter_status = EmitterStatus(name, e)
            statuses.append(emitter_status)
        return statuses
    if merge_payloads:
        statuses.extend(_emit_payload(self.payload, self.COMMON_ENDPOINT))
    else:
        statuses.extend(_emit_payload(self.data_payload, self.DATA_ENDPOINT))
        statuses.extend(_emit_payload(self.meta_payload, self.METADATA_ENDPOINT))
    return statuses
