最後のまとめで覚悟が必要とさらっと書いてありますが、どういう事かと言うと。ネイティブであればiOS SDKが標準で用意してくれる、少ないメモリ、貧弱なCPUでUIを構築するための仕組み、例えばUITableCellの再利用やGrand Central Dispatch(GCD)がHTML5/JavaScriptには無いです。独自で実装したり、WebWorkerを利用してバックグラウンドプロセスで動かすという手もありますが面倒な事に変りはありません。そのあたりをカバーしつつ、レンダリングエンジンの気持ちになって考え、DOM操作を最適化していくという覚悟が必要、という意味です。Androidに比べればWebViewがサクサク動いてくれる、というのが唯一の救い。
# requirements.txtがこんな内容だとする
$ cat requirements.txt
MySQL-python==1.2.4
python-memcached==1.53
boto==2.14.0
simplejson==3.3.1
# wheelの作成
$ pip wheel --wheel-dir=./wheelhouse -r requirments.txt
Downloading/unpacking MySQL-python==1.2.4 (from -r requirements_prod.txt (line 1))
Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
Running setup.py egg_info for package MySQL-python
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /tmp/tmpKuwtk2
Now working in /tmp/tmpKuwtk2/distribute-0.6.28
Building a Distribute egg in /web/httpd_spc/chatparty_api/python/build/MySQL-python
/web/httpd_spc/chatparty_api/python/build/MySQL-python/distribute-0.6.28-py2.6.egg
Downloading/unpacking python-memcached==1.53 (from -r requirements_prod.txt (line 2))
Downloading python-memcached-1.53.tar.gz
Running setup.py egg_info for package python-memcached
warning: no files found matching '*.rst'
warning: no files found matching '*.txt'
warning: no files found matching 'MakeFile'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.gitignore' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
Downloading/unpacking boto==2.14.0 (from -r requirements_prod.txt (line 3))
Downloading boto-2.14.0.tar.gz (1.1MB): 1.1MB downloaded
Running setup.py egg_info for package boto
warning: no files found matching 'boto/mturk/test/*.doctest'
warning: no files found matching 'boto/mturk/test/.gitignore'
Downloading/unpacking simplejson==3.3.1 (from -r requirements_prod.txt (line 4))
Downloading simplejson-3.3.1.tar.gz (67kB): 67kB downloaded
Running setup.py egg_info for package simplejson
Building wheels for collected packages: MySQL-python, python-memcached, boto, simplejson
Running setup.py bdist_wheel for MySQL-python
Destination directory: /web/httpd_spc/chatparty_api/wheelhouse
Running setup.py bdist_wheel for python-memcached
Destination directory: /web/httpd_spc/chatparty_api/wheelhouse
Running setup.py bdist_wheel for boto
Destination directory: /web/httpd_spc/chatparty_api/wheelhouse
Running setup.py bdist_wheel for simplejson
Destination directory: /web/httpd_spc/chatparty_api/wheelhouse
Successfully built MySQL-python python-memcached boto simplejson
Cleaning up...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@rabbit2:~$ sudo rabbitmqctl cluster_status
ls: cannot access /etc/rabbitmq/rabbitmq.conf.d: No such file or directory
Cluster status of node rabbit@rabbit2 ...
[{nodes,[{disc,[rabbit@rabbit1,rabbit@rabbit2]}]},
{running_nodes,[rabbit@rabbit1,rabbit@rabbit2]},
{partitions,[]}]
…done.
# AP1
[x] sent From AP1 to rabbit1: 900
[x] sent From AP1 to rabbit1: 901
[x] sent From AP1 to rabbit1: 902
[x] sent From AP1 to rabbit1: 903
[x] sent From AP1 to rabbit1: 904
[x] sent From AP1 to rabbit1: 905
[x] sent From AP1 to rabbit2: 906
[x] sent From AP1 to rabbit1: 907
[x] sent From AP1 to rabbit1: 908
[x] sent From AP1 to rabbit2: 909
# AP2
[x] sent From AP2 to rabbit2: 815
[x] sent From AP2 to rabbit1: 816
[x] sent From AP2 to rabbit2: 817
[x] sent From AP2 to rabbit2: 818
[x] sent From AP2 to rabbit2: 819
[x] sent From AP2 to rabbit2: 820
[x] sent From AP2 to rabbit1: 821
[x] sent From AP2 to rabbit1: 822
[x] sent From AP2 to rabbit2: 823
[x] sent From AP2 to rabbit1: 824
# Worker1
[x] Received 'From AP1 to rabbit1: 903'
[x] Received 'From AP1 to rabbit1: 904'
[x] Received 'From AP1 to rabbit1: 905'
[x] Received 'From AP2 to rabbit2: 820'
[x] Received 'From AP1 to rabbit1: 907'
[x] Received 'From AP1 to rabbit1: 908'
[x] Received 'From AP2 to rabbit2: 823'
# Worker2
[x] Received 'From AP1 to rabbit1: 900'
[x] Received 'From AP1 to rabbit1: 901'
[x] Received 'From AP1 to rabbit1: 902'
[x] Received 'From AP2 to rabbit2: 817'
[x] Received 'From AP2 to rabbit2: 818'
[x] Received 'From AP2 to rabbit2: 819'
[x] Received 'From AP1 to rabbit2: 906'
[x] Received 'From AP2 to rabbit1: 821'
[x] Received 'From AP2 to rabbit1: 822'
[x] Received 'From AP1 to rabbit2: 909'
[x] Received 'From AP2 to rabbit1: 824'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters