SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
Sync-Models
         Synchronizing Object Graphs in Realtime




Wednesday, 6. June 2012 [W]
Basic idea                                  Server


               Synchronize object graphs
               Push changes via long-polling
               (future plan: WebSockets, SSE)           Push!!!11one

               Every object gets an unique id
               to identify the object
               Once part of the graph - push
               updates to the client automatically
                                                        Client


Wednesday, 6. June 2012 [W]
Ingredients
               Django (only some nifty bits of it)
               gevent
               “Simple JavaScript Inheritance” by John Resig
               KnockoutJS
               kodex.sync (to be released under F/OSS license)

                                    Help wanted. Meet me
                                   at the sprint on thursday.

Wednesday, 6. June 2012 [W]
Architecture

                                       Server



                    Call      Long polling      SSE*   WebSocket


                                       Client


                                                         *Server-sent events
Wednesday, 6. June 2012 [W]
Server side

         from kodex.sync import models

         class BulletinBoard(models.RootModel):
            messages = models.ReferenceListField()

         class Message(models.Model):
            user = models.ReferenceField()
            text = models.StringField()

Wednesday, 6. June 2012 [W]
Server side
         from kodex.sync import server

         class Server(server.SyncServer):

                 def __init__(self):
                   self.root = BulletinBoard()

                 def post(message):
                   self.root.messages.append(message)

Wednesday, 6. June 2012 [W]
Client side
         <div id=”bb”>
            <ul class=”messages” data-bind=”
               foreach: root.messages”>
                <li>
                    <span class=”user” data-bind=”
                      text: user”></span>:
                   <span class=”text” data-bind=”
                      text: user”></span>
                </li>
            </ul>
         </div>
Wednesday, 6. June 2012 [W]
Client side

         bb.Client = kodex.sync.Client.extend({
            post: function(text) {
              this.request(‘post’, { text: text })
            }
         })

         var client = new bb.Client();
         $(‘#bb’).koApplyBindings(client);

Wednesday, 6. June 2012 [W]
Live Demo




Wednesday, 6. June 2012 [W]
{
                “0”: {                            Protocol
                   “class”: “bb.BulletinBoard”,
                                                   (Snapshot)
                   “messages*”: [1]
                },
                “1”: {
                   “class”: “bb.Message”,
                   “user*”: 2,
                   “text”: “What rocks?”
                },
                “2”: {
                   “class”: “auth.User”,
                   “username”: “bikeshedder”
                }
         }
Wednesday, 6. June 2012 [W]
{
                 “0”: {                         Protocol
                    “messages*”: [2, 4]              (Updates)
                 },
                 “4”: {
                    “class”: “bb.Message”,
                    “user*”: 5,
                    “text”: “Django and DjangoCon Europe 2012”
                 },
                 “5”: {
                    “class”: “auth.User”,
                    “username”: “solid”
                 }
         }
Wednesday, 6. June 2012 [W]
Protocol
                                                    (Delete)
         {
                                       Not implemented, yet.
                 “0”: {
                    “messages*”: [4]
                 },
                 “1”: null,
                 “2”: null
         }




Wednesday, 6. June 2012 [W]
http://bikeshedder.com/

                                   KODEX beta sign-up:
                              http://kodexgame.com/beta/

Wednesday, 6. June 2012 [W]

Contenu connexe

En vedette

2ª dvisão controle geral 19-02-13
2ª dvisão   controle geral  19-02-132ª dvisão   controle geral  19-02-13
2ª dvisão controle geral 19-02-13mm eventos
 
Pengolahan biodiesel (1)
Pengolahan biodiesel (1)Pengolahan biodiesel (1)
Pengolahan biodiesel (1)wahyuddin S.T
 
Petição crmv set 2013
Petição crmv set 2013Petição crmv set 2013
Petição crmv set 2013marquinhovet
 
Luna boutique lo mejor para ti (2)
Luna boutique lo mejor para ti (2)Luna boutique lo mejor para ti (2)
Luna boutique lo mejor para ti (2)lunaboutique
 
Guida al computer - Lezione 149 - Windows 8.1 Update – Modifica Impostazioni...
Guida al computer - Lezione 149 - Windows 8.1 Update –  Modifica Impostazioni...Guida al computer - Lezione 149 - Windows 8.1 Update –  Modifica Impostazioni...
Guida al computer - Lezione 149 - Windows 8.1 Update – Modifica Impostazioni...caioturtle
 
Nagaoka(20150119)
Nagaoka(20150119)Nagaoka(20150119)
Nagaoka(20150119)真 岡本
 
Cetelem Observatorio eCommerce 2014. Contexto económico
Cetelem Observatorio eCommerce 2014. Contexto económicoCetelem Observatorio eCommerce 2014. Contexto económico
Cetelem Observatorio eCommerce 2014. Contexto económicoCetelem
 
Resultado da eleições 2010 em bom sucesso senador
Resultado da eleições 2010 em bom sucesso senadorResultado da eleições 2010 em bom sucesso senador
Resultado da eleições 2010 em bom sucesso senadorJoao Rivonaldo Silva
 
Windows 8 license me or not
Windows 8 license me or notWindows 8 license me or not
Windows 8 license me or notMarko Gulan
 
Računarske mreže
Računarske mrežeRačunarske mreže
Računarske mrežeSofiya96
 
Candidatura EspontâNea
Candidatura EspontâNeaCandidatura EspontâNea
Candidatura EspontâNeatetepepe
 
Controle geral escolas com medalhas 2.0
Controle geral escolas com medalhas 2.0Controle geral escolas com medalhas 2.0
Controle geral escolas com medalhas 2.0afranio soares
 

En vedette (19)

2ª dvisão controle geral 19-02-13
2ª dvisão   controle geral  19-02-132ª dvisão   controle geral  19-02-13
2ª dvisão controle geral 19-02-13
 
Pengolahan biodiesel (1)
Pengolahan biodiesel (1)Pengolahan biodiesel (1)
Pengolahan biodiesel (1)
 
Segunda guerra mundial (2)
Segunda guerra mundial (2)Segunda guerra mundial (2)
Segunda guerra mundial (2)
 
Petição crmv set 2013
Petição crmv set 2013Petição crmv set 2013
Petição crmv set 2013
 
CoesãO 1
CoesãO 1CoesãO 1
CoesãO 1
 
Luna boutique lo mejor para ti (2)
Luna boutique lo mejor para ti (2)Luna boutique lo mejor para ti (2)
Luna boutique lo mejor para ti (2)
 
Guida al computer - Lezione 149 - Windows 8.1 Update – Modifica Impostazioni...
Guida al computer - Lezione 149 - Windows 8.1 Update –  Modifica Impostazioni...Guida al computer - Lezione 149 - Windows 8.1 Update –  Modifica Impostazioni...
Guida al computer - Lezione 149 - Windows 8.1 Update – Modifica Impostazioni...
 
Compra articulo
Compra articuloCompra articulo
Compra articulo
 
Nagaoka(20150119)
Nagaoka(20150119)Nagaoka(20150119)
Nagaoka(20150119)
 
Cetelem Observatorio eCommerce 2014. Contexto económico
Cetelem Observatorio eCommerce 2014. Contexto económicoCetelem Observatorio eCommerce 2014. Contexto económico
Cetelem Observatorio eCommerce 2014. Contexto económico
 
O reg 06
O reg 06O reg 06
O reg 06
 
Resultado da eleições 2010 em bom sucesso senador
Resultado da eleições 2010 em bom sucesso senadorResultado da eleições 2010 em bom sucesso senador
Resultado da eleições 2010 em bom sucesso senador
 
Windows 8 license me or not
Windows 8 license me or notWindows 8 license me or not
Windows 8 license me or not
 
Računarske mreže
Računarske mrežeRačunarske mreže
Računarske mreže
 
Bingo z
Bingo zBingo z
Bingo z
 
Candidatura EspontâNea
Candidatura EspontâNeaCandidatura EspontâNea
Candidatura EspontâNea
 
Controle geral escolas com medalhas 2.0
Controle geral escolas com medalhas 2.0Controle geral escolas com medalhas 2.0
Controle geral escolas com medalhas 2.0
 
Atual Morada, Rossi
Atual Morada, RossiAtual Morada, Rossi
Atual Morada, Rossi
 
1. grasiv eppt formato
1. grasiv eppt formato1. grasiv eppt formato
1. grasiv eppt formato
 

Similaire à Djangocon Europe 2012 - Sync-Models

Building Your First MongoDB App ~ Metadata Catalog
Building Your First MongoDB App ~ Metadata CatalogBuilding Your First MongoDB App ~ Metadata Catalog
Building Your First MongoDB App ~ Metadata Cataloghungarianhc
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the CloudJames Thomas
 
Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13MongoDB
 
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack SissonMongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack SissonHakka Labs
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slideshelenmga
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
 
Building Microservivces with Java EE 8 and Microprofile
Building Microservivces with Java EE 8 and MicroprofileBuilding Microservivces with Java EE 8 and Microprofile
Building Microservivces with Java EE 8 and MicroprofileQAware GmbH
 
Dojo: Beautiful Web Apps, Fast
Dojo: Beautiful Web Apps, FastDojo: Beautiful Web Apps, Fast
Dojo: Beautiful Web Apps, FastGabriel Hamilton
 
Cloud-ready Micro Java EE 8
Cloud-ready Micro Java EE 8Cloud-ready Micro Java EE 8
Cloud-ready Micro Java EE 8Payara
 
MongoDB and Web Scrapping with the Gyes Platform
MongoDB and Web Scrapping with the Gyes PlatformMongoDB and Web Scrapping with the Gyes Platform
MongoDB and Web Scrapping with the Gyes PlatformMongoDB
 
GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day DNG Consulting
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo ToolkitThomas Koch
 
Dojo javascript toolkit
Dojo javascript toolkit Dojo javascript toolkit
Dojo javascript toolkit Predhin Sapru
 
OAE Developer Bootcamp
OAE Developer BootcampOAE Developer Bootcamp
OAE Developer BootcampBert Pareyn
 

Similaire à Djangocon Europe 2012 - Sync-Models (20)

Building Your First MongoDB App ~ Metadata Catalog
Building Your First MongoDB App ~ Metadata CatalogBuilding Your First MongoDB App ~ Metadata Catalog
Building Your First MongoDB App ~ Metadata Catalog
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
 
Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13
 
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack SissonMongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
 
Resume_eng
Resume_engResume_eng
Resume_eng
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slides
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
Building Microservivces with Java EE 8 and Microprofile
Building Microservivces with Java EE 8 and MicroprofileBuilding Microservivces with Java EE 8 and Microprofile
Building Microservivces with Java EE 8 and Microprofile
 
Dojo: Beautiful Web Apps, Fast
Dojo: Beautiful Web Apps, FastDojo: Beautiful Web Apps, Fast
Dojo: Beautiful Web Apps, Fast
 
Test02
Test02Test02
Test02
 
Cloud-ready Micro Java EE 8
Cloud-ready Micro Java EE 8Cloud-ready Micro Java EE 8
Cloud-ready Micro Java EE 8
 
MongoDB and Web Scrapping with the Gyes Platform
MongoDB and Web Scrapping with the Gyes PlatformMongoDB and Web Scrapping with the Gyes Platform
MongoDB and Web Scrapping with the Gyes Platform
 
Extending Studio
Extending StudioExtending Studio
Extending Studio
 
GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day
 
Complete Dojo
Complete DojoComplete Dojo
Complete Dojo
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo Toolkit
 
utpal
utpalutpal
utpal
 
Dojo javascript toolkit
Dojo javascript toolkit Dojo javascript toolkit
Dojo javascript toolkit
 
OAE Developer Bootcamp
OAE Developer BootcampOAE Developer Bootcamp
OAE Developer Bootcamp
 
Live Node.JS Training
Live Node.JS TrainingLive Node.JS Training
Live Node.JS Training
 

Dernier

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Dernier (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Djangocon Europe 2012 - Sync-Models

  • 1. Sync-Models Synchronizing Object Graphs in Realtime Wednesday, 6. June 2012 [W]
  • 2. Basic idea Server Synchronize object graphs Push changes via long-polling (future plan: WebSockets, SSE) Push!!!11one Every object gets an unique id to identify the object Once part of the graph - push updates to the client automatically Client Wednesday, 6. June 2012 [W]
  • 3. Ingredients Django (only some nifty bits of it) gevent “Simple JavaScript Inheritance” by John Resig KnockoutJS kodex.sync (to be released under F/OSS license) Help wanted. Meet me at the sprint on thursday. Wednesday, 6. June 2012 [W]
  • 4. Architecture Server Call Long polling SSE* WebSocket Client *Server-sent events Wednesday, 6. June 2012 [W]
  • 5. Server side from kodex.sync import models class BulletinBoard(models.RootModel): messages = models.ReferenceListField() class Message(models.Model): user = models.ReferenceField() text = models.StringField() Wednesday, 6. June 2012 [W]
  • 6. Server side from kodex.sync import server class Server(server.SyncServer): def __init__(self): self.root = BulletinBoard() def post(message): self.root.messages.append(message) Wednesday, 6. June 2012 [W]
  • 7. Client side <div id=”bb”> <ul class=”messages” data-bind=” foreach: root.messages”> <li> <span class=”user” data-bind=” text: user”></span>: <span class=”text” data-bind=” text: user”></span> </li> </ul> </div> Wednesday, 6. June 2012 [W]
  • 8. Client side bb.Client = kodex.sync.Client.extend({ post: function(text) { this.request(‘post’, { text: text }) } }) var client = new bb.Client(); $(‘#bb’).koApplyBindings(client); Wednesday, 6. June 2012 [W]
  • 9. Live Demo Wednesday, 6. June 2012 [W]
  • 10. { “0”: { Protocol “class”: “bb.BulletinBoard”, (Snapshot) “messages*”: [1] }, “1”: { “class”: “bb.Message”, “user*”: 2, “text”: “What rocks?” }, “2”: { “class”: “auth.User”, “username”: “bikeshedder” } } Wednesday, 6. June 2012 [W]
  • 11. { “0”: { Protocol “messages*”: [2, 4] (Updates) }, “4”: { “class”: “bb.Message”, “user*”: 5, “text”: “Django and DjangoCon Europe 2012” }, “5”: { “class”: “auth.User”, “username”: “solid” } } Wednesday, 6. June 2012 [W]
  • 12. Protocol (Delete) { Not implemented, yet. “0”: { “messages*”: [4] }, “1”: null, “2”: null } Wednesday, 6. June 2012 [W]
  • 13. http://bikeshedder.com/ KODEX beta sign-up: http://kodexgame.com/beta/ Wednesday, 6. June 2012 [W]