Sends emails in a continuous loop
515846
public function actionLoop($loopLimit = 1000, $spoolLimit = 10)
    {
        for ($i = 0; $i < $loopLimit; $i++) {
            $done = Yii::app()->emailManager->spool($spoolLimit);
            if ($done) {
                for ($i = 0; $i < $done; $i++) {
                    echo '.';
                }
            }
            sleep(1);
        }
    }
147970
function send(){
  this.forEach(function(worker){
    worker.send.apply(worker, [].slice.apply(arguments));
  });
}
580718
def polling_loop(timeout, interval=1):
    """"""
    start_time = time.time()
    iteration = 0
    end_time = start_time + timeout
    while time.time() < end_time:
        yield iteration
        iteration += 1
        time.sleep(interval)
1241704
def run_loop(self, request_cb, notification_cb,
                 setup_cb=None, err_cb=None):
        
        if err_cb is None:
            err_cb = sys.stderr.write
        self._err_cb = err_cb

        def filter_request_cb(name, args):
            name = self._from_nvim(name)
            args = walk(self._from_nvim, args)
            try:
                result = request_cb(name, args)
            except Exception:
                msg = ("error caught in request handler '{} {}'\n{}\n\n"
                       .format(name, args, format_exc_skip(1)))
                self._err_cb(msg)
                raise
            return walk(self._to_nvim, result)

        def filter_notification_cb(name, args):
            name = self._from_nvim(name)
            args = walk(self._from_nvim, args)
            try:
                notification_cb(name, args)
            except Exception:
                msg = ("error caught in notification handler '{} {}'\n{}\n\n"
                       .format(name, args, format_exc_skip(1)))
                self._err_cb(msg)
                raise

        self._session.run(filter_request_cb, filter_notification_cb, setup_cb)
394808
def add_to_emails(self, *emails):
        
        assert all(isinstance(element, (str, unicode)) for element in emails), emails
        post_parameters = emails
        headers, data = self._requester.requestJsonAndCheck(
            "POST",
            "/user/emails",
            input=post_parameters
        )
870965
def emails(self, qs):
        
        self.stdout.write(",\n".join(ent['email'] for ent in qs))
        self.stdout.write("\n")
1270134
public void send(Email email) throws EmailException {
    synchronized (this) {
      EmailConnection connection = openConnection();
      connection.connect();
      
      connection.send(email);
      
      connection.close();
    }
  }
24262
def create_mailbox(self, actor, loop):
        ''''''
        client = MailboxClient(actor.monitor.address, actor, loop)
        loop.call_soon_threadsafe(self.hand_shake, actor)
        return client
974707
def sendall(self, data, flags=0):
        ''''''
        count = len(data)
        while count:
            sent = self.send(data, flags)
            # This could probably be a buffer object
            data = data[sent:]
            count -= sent
272463
public void send(final MailInfo mailInfo) {
		try {
			final MultiPartEmail email = new MultiPartEmail();
			email.setCharset("utf-8");
			mailInfo.fillEmail(email);
			email.send();
		} catch (Exception e) {
			JK.throww(e);
		}
	}
1228003
def send_mail(subject, message, from_email, recipient_list, html_message='',
              scheduled_time=None, headers=None, priority=PRIORITY.medium):
    

    subject = force_text(subject)
    status = None if priority == PRIORITY.now else STATUS.queued
    emails = []
    for address in recipient_list:
        emails.append(
            Email.objects.create(
                from_email=from_email, to=address, subject=subject,
                message=message, html_message=html_message, status=status,
                headers=headers, priority=priority, scheduled_time=scheduled_time
            )
        )
    if priority == PRIORITY.now:
        for email in emails:
            email.dispatch()
    return emails
580885
def recipients(self):
        
        return [email for email in (self.to + self.cc + self.bcc) if email]
1331822
def updater_loop(self):
        
        self.updater_running = True
        while (self.updater_running):
            self.send_updates()
            sleep(self.updateinterval)
971122
function ListenToEmail(params) {
        RED.nodes.createNode(this, params);
        this.name = params.name;
        this.waitfor = params.waitfor;
        let node = this;
        this.on('input', function(msg) {
            if (msg.error) {
                // FIXME: Add error handling here
            } else {
                node.log('ListenToEmail');
                // node.log(JSON.stringify(params));
                retryParams = params;
                emailInNode(node, params, msg);
            }
        });
        this.on('close', function() {
            if (node.interval_id != null) {
                clearInterval(node.interval_id);
            }
            if (imap) {
                imap.destroy();
            }
        });

        // Repeat interval
        if (!isNaN(params.repeat) && params.repeat > 0) {
            node.interval_id = setInterval(function() {
                if (retryParams) {
                    console.log('>Calling node emit input');
                    node.emit('input', retryParams);
                }
            }, params.repeat * 1000);
        }
    }
542687
def send_email(sender, msg, driver):
    
    driver.users().messages().send(
        userId=sender,
        body=msg
    ).execute()
365295
def get_emails(self, limit=100, offset=0, conditions={}):
        
        url = self.EMAILS_URL + "?limit=%s&offset=%s" % (limit, offset)

        for key, value in conditions.items():
            if key is 'ids':
                value = ",".join(value)

            url += '&%s=%s' % (key, value)

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.get_request()
881278
def send(self, **extra):
        
        emails = self.as_dict(**extra)
        responses = [self._manager._send_batch(*batch) for batch in chunks(emails, self.MAX_SIZE)]
        return sum(responses, [])