meteor.js + DDP + webSockets + Objective-C

Its an introductory blog post which aims at projecting an overview of all the above technologies and how they can be used together.

Introduction #

Meteor is an open-source JavaScript platform for building web apps.

http://docs.meteor.com/ #

Installation:

[curl https://install.meteor.com | /bin/sh]

First Project:

meteor create ~/myapp
cd ~/myapp
meteor

Notes:


http://meteorhacks.com/introduction-to-ddp.html #

DDP - Distributed Data Protocol

  • Meteor uses it to communicate between the client and the server
  • It is a protocol based on JSON
  • Meteor’s current implementation is based on WebSockets and SockJS
  • SockJS is a WebSockets emulation transport, which can be used when WebSockets is not available.

What DDP do ?

  • it handles RPCs (Remote Procedural Calls)
  • it manages data

RPC

  • 3 step process
    • request (aka methods)
    • result
    • update

Managing Data

  • A client can use it to subscribe into a real-time data source and get notifications.
  • The DDP protocol has three types of notification: added, changed and removed.
  • Since the DDP protocol was inspired by MongoDB, each data notification (a JSON object) is assigned to a collection, which is the place where the data belongs.

https://www.meteor.com/blog/2012/03/21/introducing-ddp #

More stuff on DDP

  • On the server, you define a realtime queries using Meteor.publish. You can publish data from any source.
  • On the client, you call Meteor.subscribe to connect to a publication endpoint, receive the data, and listen for updates. The data is inserted directly into Meteor’s client-side cache, so you can bind your HTML templates to it and they’ll update automatically.

WebSockets #

Introduction

  • it makes it possible to open an interactive communication session between the user’s browser and a server.
  • With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.

further reading #

 
26
Kudos
 
26
Kudos

Now read this

Dynamic Cell Size in UITableView - new iOS 8 api

One of the new iOS-8 api allow the developers to provide dynamic height to their tableView cells without much hassle. So now we don’t have to implement the following method - (CGFloat)tableView:(UITableView *)tableView... Continue →