Instantly share code, notes, and snippets.

View run.py
from tasks import timeout_and_chords
timeout_and_chords.delay()
View run.py
from tasks import hello, timeout_test, retry_timeout_test, max_retries_test, max_retries_test_2
hello.delay()
timeout_test.delay()
retry_timeout_test.delay()
max_retries_test.delay()
max_retries_test_2.delay()
View run.py
# Refer https://adikrishnan.in/2018/05/30/playing-with-chords-celery/ for understanding the concept.
from tasks import hello, chord_service, non_chord_service
hello.delay()
chord_service.delay()
non_chord_service.delay()
View run.py
# Refer https://adikrishnan.in/2018/05/30/celery-groups-loops-parallelism/ for understanding the concept.
from tasks import run_ping, hello, loop_service, group_service
hello.delay()
loop_service.delay()
group_service.delay()
View py_web_service_gunicorn.conf
[supervisord]
# [program:<samplepyservice>]
[program:myapp]
# directory=<path_to_project>
directory=/var/www/myapp
# command=<path_to_project_env>/env/bin/gunicorn -b 127.0.0.1:<port_num> -w 4 <app_name>:app
command=/var/www/myapp/env/bin/gunicorn -b 127.0.0.1:5000 -w 4 myapp:app
autostart=true
autorestart=true
# user=<username>
View .bash_profile
alias vi='vim'
alias ls='ls -lh --color=auto'
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export FLASK_APP=runserver.py
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "cygnus"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", path: "setup_environment.sh"
end