wirecloud-PubSub PubSub desteği sağlayan bir Wirecloud eklentisi.
Kurulum
* Wirecloud_pubsub * django.contrib.static işlevleri kullanır olduğundan, settings.py`` `` sizin `` INSTALLED_APPS`` eklemek gerekir:
& Nbsp; & nbsp; & nbsp; INSTALLED_APPS (=
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ...
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; 'Wirecloud_pubsub'
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ...
& Nbsp; & nbsp; & nbsp; )
Ayrıca size `` WIRECLOUD_PLUGINS`` eklemek zorunda:
& Nbsp; & nbsp; & nbsp; WIRECLOUD_PLUGINS (=
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ...
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; 'Wirecloud_pubsub.wirecloud.PubSubPlugin'
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ...
& Nbsp; & nbsp; & nbsp; )
Senin Wirecloud yükleme komutları collectstatic çalıştırmak ve sıkıştırmak unutmayın:
& Nbsp; & nbsp; & nbsp; & nbsp; ./manage.py collectstatic
& Nbsp; & nbsp; & nbsp; & nbsp; ./manage.py kompres
Kullanım
Wirecloud-PubSub yüklü ve aktive edildiğinde, araçlar EzWebAPI.SilboPS aracılığıyla PubSub functionallities yararlanabilirsiniz. Şu anda, EzWebAPI.SilboPS sadece PubEndPoint, SubEndPoint ve Filtre sınıfları ihraç etmektedir. SilboPS tam dokümantasyon https://svn.forge.morfeo-project.org/4caast/trunk/WP6/pubsub/README.md mevcuttur.
Örnek
::
& Nbsp; & nbsp; & nbsp; var son nokta;
& Nbsp; & nbsp; & nbsp; fonksiyonu yayımlamak () {
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ({'değer': 'Merhaba dünya!'}) endpoint.publish;
& Nbsp; & nbsp; & nbsp; }
& Nbsp; & nbsp; & nbsp; fonksiyon start_publishing () {
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; endpoint.advertise ({'değer', ['str']});
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; setInterval (2000 yayınlamak);
& Nbsp; & nbsp; & nbsp; }
& Nbsp; & nbsp; & nbsp; bitiş noktası = EzWebAPI.SilboPS.PubEndPoint ({
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; OnOpen: function (son nokta) {
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; alert ('Endpoint hazır');
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; () start_publishing;
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; },
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; OnClose: function (son nokta) {
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; alert ('Endpoint kapalı');
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; }
& Nbsp; & nbsp; & nbsp; })
Gereksinimler :
- Python
- Wirecloud
- PubSub sunucusu (https://svn.forge.morfeo-project.org/4caast/trunk/WP6/pubsub)
Yorum Bulunamadı