one group per user

64 views
Skip to first unread message

Dor Tzur

unread,
Jan 10, 2012, 8:28:40 AM1/10/12
to no...@googlegroups.com
I would like to access a user the same way i access a group.
would it be wise to create a new group with unique identifier for each user?

Eric Zhang

unread,
Jan 10, 2012, 11:03:46 AM1/10/12
to no...@googlegroups.com
Hey Dor,

You can use the nowjs.getClient feature to do that much more easily.http://nowjs.com/jsdoc/symbols/nowjs.html#getClient


Eric




On Tue, Jan 10, 2012 at 5:28 AM, Dor Tzur <dor...@gmail.com> wrote:
I would like to access a user the same way i access a group.
would it be wise to create a new group with unique identifier for each user?



--
Co-Founder @ Flotype, makers of NowJS

Dor Tzur

unread,
Jan 10, 2012, 3:48:32 PM1/10/12
to nowjs
I'm aware of the clientId identifier and the nowjs.getClient
However, i'm using a RESTful service to push data from a remote server
to our users through now.js. The server only knows about an external-
ID.
The way i see it i have two options:

A. keep a pairing of an external-ID to a client-ID on the remote
server or the now.js server, refreshing the client-ID on each page
change (the external-ID is consistent throughout the session), and
then using the nowjs.getClient method as you suggested.

B. Creating a group with that user's external-ID and adding him to
that group on each page change, essentially creating the pairing that
way, as i implied originally.

I hope i was clear enough with my explanation, I would sincerely like
to hear your thoughts on the subject matter.
Thanks for the quick response.


On Jan 10, 6:03 pm, Eric Zhang <e...@nowjs.com> wrote:
> Hey Dor,
>
> You can use the nowjs.getClient feature to do that much more easily.http://nowjs.com/jsdoc/symbols/nowjs.html#getClient
>
> Eric
>

Ian Serlin

unread,
Jan 10, 2012, 6:57:38 PM1/10/12
to no...@googlegroups.com
Are you talking about just keeping track of a user across page refreshes, like you normally do with a session? You have access to session cookies in nowjs but you can also take a look at a couple nowjs extensions I'm working on, and contribute if you want! 

https://github.com/ianserlin/now-middleware - let's you hook into the remote function call sequence and inject callbacks that do things (like process data) before the server-side function the client was actually trying to call is executed
https://github.com/ianserlin/now-sessions - uses now-middleware to make standard http session information to server-side now callbacks via this.now.session inside your function

Dor Tzur

unread,
Jan 11, 2012, 3:33:22 AM1/11/12
to nowjs
yeah that should fit the bill.
Is it production ready in your opinion?

On Jan 11, 1:57 am, Ian Serlin <i...@ianserlin.com> wrote:
> Are you talking about just keeping track of a user across page refreshes,
> like you normally do with a session? You have access to session cookies in
> nowjs but you can also take a look at a couple nowjs extensions I'm working
> on, and contribute if you want!
>
> https://github.com/ianserlin/now-middleware- let's you hook into the
> remote function call sequence and inject callbacks that do things (like
> process data) before the server-side function the client was actually
> trying to call is executedhttps://github.com/ianserlin/now-sessions- uses now-middleware to make
> standard http session information to server-side now callbacks via
> this.now.session inside your function
>
> Ian Serlin
>
> i...@ianserlin.com
> http://u <http://ianserlin.com>seful.iohttp://www.linkedin.com/in/ianserlin

Ian Serlin

unread,
Jan 11, 2012, 1:37:45 PM1/11/12
to no...@googlegroups.com
I wouldn't say it's production ready because it has no tests. Don't have time to look into doing that today though but I am using these in a project I'm working on so I don't have to look up the current user's session information every time I make a call to a server-side function either through a getClient hash or by having the client pass it's user.id.
Reply all
Reply to author
Forward
0 new messages