Re: Turn-based Game using Couchbase Mobile

2014-05-09 Thread Dave Holdsworth
Yes, the --stream option for httpie sorts it out. I've now got it working with follow and feed=continuous Thanks a lot. On Thursday, 8 May 2014 10:36:19 UTC+1, Dave Holdsworth wrote: > > I am considering building a turn-based card game using Couchbase Mobile. > > The playing sequence is as follow

Re: Turn-based Game using Couchbase Mobile

2014-05-09 Thread Jens Alfke
On May 9, 2014, at 8:06 AM, Dave Holdsworth wrote: > I've just been using httpie to play around with sync_gateway using walrus. > I've set up a public channel with guest accounts. > Calling the Admin API for _changes on 4985 in one window and PUT a doc on > 4984 in another. > Changes came throu

Re: Turn-based Game using Couchbase Mobile

2014-05-09 Thread Dave Holdsworth
I've just been using httpie to play around with sync_gateway using walrus. I've set up a public channel with guest accounts. Calling the Admin API for _changes on 4985 in one window and PUT a doc on 4984 in another. Changes came through immediately for feed==longpoll but when I tried feed==contin

Re: Turn-based Game using Couchbase Mobile

2014-05-09 Thread Jens Alfke
On May 9, 2014, at 12:49 AM, Dave Holdsworth wrote: > Thanks for the advice. Unfortunately the _changes feed=continuous doesn't > seem to behave very well for the sync_gateway (or I've misunderstood how to > get it to work) What goes wrong? As far as I know, continuous feed works fine. --Jen

Re: Turn-based Game using Couchbase Mobile

2014-05-09 Thread J. Chris Anderson
It's not super well documented but coax has a changes handler that uses longpoll: https://github.com/jchris/coax On Friday, May 9, 2014 12:49:36 AM UTC-7, Dave Holdsworth wrote: > > Thanks for the advice. Unfortunately the _changes feed=continuous doesn't > seem to behave very well for the sync_

Re: Turn-based Game using Couchbase Mobile

2014-05-09 Thread Dave Holdsworth
Thanks for the advice. Unfortunately the _changes feed=continuous doesn't seem to behave very well for the sync_gateway (or I've misunderstood how to get it to work) and it looks like follow is built on that. I should be able to roll my own using feed=longpolling. On Thursday, 8 May 2014 10:36:1

Re: Turn-based Game using Couchbase Mobile

2014-05-08 Thread Matt Quinn
On Thu, May 08, 2014 at 12:54:45PM -0700, Dave Holdsworth wrote: > One other thing: is there any documentation on how a server side bot (say a > node program) can access the sync_gateway websocket interface directly for > the _changes feed? If you can use HTTP instead, follow[0] is a nice library

Re: Turn-based Game using Couchbase Mobile

2014-05-08 Thread Jens Alfke
On May 8, 2014, at 12:54 PM, Dave Holdsworth wrote: > One other thing: is there any documentation on how a server side bot (say a > node program) can access the sync_gateway websocket interface directly for > the _changes feed? The best documentation is in the CouchDB API docs. The WebSocket

Re: Turn-based Game using Couchbase Mobile

2014-05-08 Thread Dave Holdsworth
Thanks for the response - I think I understand channels now. One other thing: is there any documentation on how a server side bot (say a node program) can access the sync_gateway websocket interface directly for the _changes feed? On Thursday, 8 May 2014 10:36:19 UTC+1, Dave Holdsworth wrote:

Re: Turn-based Game using Couchbase Mobile

2014-05-08 Thread Jens Alfke
On May 8, 2014, at 2:36 AM, Dave Holdsworth wrote: > A) a channel per player and duplicate the game state to both, plus the cards > to the next player to act That seems right. You wouldn't be duplicating the game state, just tagging its docs with both channels. Or if you prefer, you could hav

Turn-based Game using Couchbase Mobile

2014-05-08 Thread Dave Holdsworth
I am considering building a turn-based card game using Couchbase Mobile. The playing sequence is as follows: Deal cards to Player 1 (face-down) Player 1 Actions (on table) Deal cards to Player 2 Player 2 Actions Deal cards to Player 1 A server will deal the cards