Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
prophet777 committed Apr 18, 2015
1 parent f42c054 commit c9ba49d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Resources/docs/ClientSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ The following commands are available to a GosSocket object returned by WS.connec
This allows you to listen for events called by GosSocket. The only events fired currently are "socket/connect" and "socket/disconnect".

```javascript
var myWebSocket = WS.connect("ws://127.0.0.1:8080");
var webSocket = WS.connect("ws://127.0.0.1:8080");

myWebSocket.on("socket/connect", function(session){
webSocket.on("socket/connect", function(session){
//session is an Autobahn JS WAMP session.

console.log("Successfully Connected!");
})

myWebSocket.on("socket/disconnect", function(error){
webSocket.on("socket/disconnect", function(error){
//error provides us with some insight into the disconnection: error.reason and error.code

console.log("Disconnected for " + error.reason + " with code " + error.code);
Expand All @@ -66,7 +66,7 @@ For a more in depth description of PubSub architecture, see [Autobahn JS PubSub
These are all fairly straightforward, here's an example on using them:

```javascript
myWebSocket.on("socket/connect", function(session){
webSocket.on("socket/connect", function(session){

//the callback function in "subscribe" is called everytime an event is published in that channel.
session.subscribe("acme/channel", function(uri, payload){
Expand Down
4 changes: 3 additions & 1 deletion Resources/docs/RPCSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ The idea of having these network namespaces is to group relevant code into separ

Now you have create your RPC service and implements your RPC call in the client, you must now link the path with your service. `sample/add_func` will refer to AcmeService

if he not already exists, create `AcmeBundle/Resources/config/pubsub/routing.yml` and register it in the websocket bundle configuration :
if he not already exists, create `AcmeBundle/Resources/config/pubsub/routing.yml` and register it in the websocket bundle configuration

**NOTE** : Don't forget to clear your cache take in account the new file.

```yaml
gos_web_socket:
Expand Down
13 changes: 12 additions & 1 deletion Resources/docs/TopicSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ The following javascript will show connecting to this topic, notice how "acme/ch

Now will say to the system, topic named `acme.topic` (related to Topic::getName())` will handle channel pattern.

if he not already exists, create `AcmeBundle/Resources/config/pubsub/routing.yml` and register it in the websocket bundle configuration :
if he not already exists, create `AcmeBundle/Resources/config/pubsub/routing.yml` and register it in the websocket bundle configuration

**NOTE** : Don't forget to clear your cache take in account the new file.

```yaml
gos_web_socket:
Expand All @@ -228,6 +230,15 @@ gos_web_socket:

Create the route to rely channel / topic

```yaml
acme_topic:
channel: acme/channel
handler:
callback: 'acme.topic' #related to the getName() of your topic
```
###Advanced example
```yaml
acme_topic_chat:
channel: acme/chat/{room}/{user_id}
Expand Down

0 comments on commit c9ba49d

Please sign in to comment.