Skip to content

Commit

Permalink
Update and tweak docs for new name.
Browse files Browse the repository at this point in the history
  • Loading branch information
n1mmy committed Dec 5, 2013
1 parent 91ad6c0 commit a3bbb6d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 56 deletions.
41 changes: 19 additions & 22 deletions docs/client/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ <h2 id="publishandsubscribe"><span>Publish and subscribe</span></h2>
{{> api_box subscription_error}}
{{> api_box subscription_stop}}

{{> api_box subscription_session}}
{{> api_box subscription_connection}}

{{> api_box subscribe}}

Expand Down Expand Up @@ -278,8 +278,7 @@ <h2 id="methods_header"><span>Methods</span></h2>
begin running.
* `userId`: the id of the current user.
* `setUserId`: a function that associates the current client with a user.
* `session`: on the server, the [session](#ddp_session) this method
call came in on.
* `connection`: on the server, the [connection](#meteor_onconnection) this method call was received on.

Calling `methods` on the client defines *stub* functions associated with
server methods of the same name. You don't have to define a stub for
Expand Down Expand Up @@ -332,7 +331,7 @@ <h2 id="methods_header"><span>Methods</span></h2>
returns. However, you can change this by calling `this.unblock`. This
will allow the N+1th invocation to start running in a new fiber.

{{> api_box method_invocation_session}}
{{> api_box method_invocation_connection}}

{{> api_box error}}

Expand Down Expand Up @@ -479,26 +478,29 @@ <h2 id="connections"><span>Server connections</span></h2>
[session](#ddp_session) representing the connection from the client.


{{> api_box ddp_session}}
<dl class="objdesc">
{{#dtdd name="id" type="String"}}
A globally unique id for this connection.
{{/dtdd}}

{{#dtdd name="close" type="Function"}}
Close this DDP connection. The client is free to reconnect, but will
receive a different connection with a new `id` if it does.
{{/dtdd}}

{{#dtdd name="onClose" type="Function"}}
Register a callback to be called when the connection is closed.
{{/dtdd}}
</dl>

{{#note}}
Currently when a client reconnects to the server (such as after
temporarily losing its Internet connection), it will get a new session
each time.

When session reconnects are implemented, clients will be able to
reconnect to the same session.

The `Meteor.onConnection` callback will be called only once for a
session. A client reconnecting to the same session won't cause the
callback to be called again.
In the future, when session reconnection is implemented, clients will be
able to reconnect and resume the same session.

The client closing the connection won't cause the session to close
right away because the client might reconnect; instead the session
will close after a timeout. Once the session has been closed
(including when the session `close` method is called), a reconnect
from the client attempting to reuse the session will receive a new
session instead.
{{/note}}


Expand Down Expand Up @@ -3111,11 +3113,6 @@ <h4>Options</h4>
{{> api_box_args options}}
{{/if}}

{{#if fields}}
<h4>Fields</h4>
{{> api_box_args fields}}
{{/if}}

{{#if body}}
{{#better_markdown}}{{{body}}}{{/better_markdown}}
{{/if}}
Expand Down
40 changes: 9 additions & 31 deletions docs/client/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ Template.api.subscription_userId = {
};


Template.api.subscription_session = {
id: "publish_session",
name: "<i>this</i>.session",
Template.api.subscription_connection = {
id: "publish_connection",
name: "<i>this</i>.connection",
locus: "Server",
descr: ["Access inside the publish function. The [session](#ddp_session) this subscription came in on."]
descr: ["Access inside the publish function. The incoming [connection](#meteor_onconnection) for this subscription."]
};


Expand Down Expand Up @@ -389,11 +389,11 @@ Template.api.method_invocation_isSimulation = {
descr: ["Access inside a method invocation. Boolean value, true if this invocation is a stub."]
};

Template.api.method_invocation_session = {
id: "method_session",
name: "<i>this</i>.session",
Template.api.method_invocation_connection = {
id: "method_connection",
name: "<i>this</i>.connection",
locus: "Server",
descr: ["Access inside a method invocation. The [session](#meteor_onconnection) this method call came in on."]
descr: ["Access inside a method invocation. The [connection](#meteor_onconnection) this method was received on."]
};

Template.api.error = {
Expand Down Expand Up @@ -502,32 +502,10 @@ Template.api.onConnection = {
args: [
{name: "callback",
type: "function",
descr: "The function to call with the session when a new DDP connection is established."}
descr: "The function to call when a new DDP connection is established."}
]
};

Template.api.ddp_session = {
id: "ddp_session",
name: "DDP.Session",
locus: "Server",
descr: ["On the server, this object represents a connection from a client."],
fields: [
{name: "id",
type: "String",
descr: "The globally unique session id."
},
{name: "close",
type: "Function",
descr: "Close this session and the associated DDP connection. The client is free to reconnect, but will receive a different session if it does."
},
{name: "onClose",
type: "Function",
descr: "Register a callback to be called when the session is closed."
}
]
};


// onAutopublish

Template.api.meteor_collection = {
Expand Down
5 changes: 2 additions & 3 deletions docs/client/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ var toc = [
{instance: "this", name: "onStop", id: "publish_onstop"},
{instance: "this", name: "error", id: "publish_error"},
{instance: "this", name: "stop", id: "publish_stop"},
{instance: "this", name: "session", id: "publish_session"}
{instance: "this", name: "connection", id: "publish_connection"}
],
"Meteor.subscribe"
],
Expand All @@ -134,7 +134,7 @@ var toc = [
{instance: "this", name: "setUserId", id: "method_setUserId"},
{instance: "this", name: "isSimulation", id: "method_issimulation"},
{instance: "this", name: "unblock", id: "method_unblock"},
{instance: "this", name: "session", id: "method_session"}
{instance: "this", name: "connection", id: "method_connection"}
],
"Meteor.Error",
"Meteor.call",
Expand All @@ -146,7 +146,6 @@ var toc = [
"Meteor.reconnect",
"Meteor.disconnect",
"Meteor.onConnection",
"DDP.Session",
"DDP.connect"
],

Expand Down

0 comments on commit a3bbb6d

Please sign in to comment.