SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
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]

Weitere ähnliche Inhalte

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

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]