Commit Graph

15 Commits

Author SHA1 Message Date
Zev Benjamin cf8cf1fe03 socket: Fix non-rabbitmq codepath
(imported from commit 3ccdcbfb3283fc57ca502878e9c8d6068e7bce40)
2013-11-12 16:42:15 -05:00
Zev Benjamin 673f497a6f socket: Only deregister connections that have been registered
(imported from commit bfaed299a129bac1e901883f5c6e3339f5a8b688)
2013-11-12 15:24:30 -05:00
Zev Benjamin eec195f421 socket: Use our full logging infrastructure
We also now separate out the times for the socket overhead, the
request service time, and the queuing delays.

(imported from commit e1683f7f28b968b86ebb701b0ac29b00ac6d67c3)
2013-11-12 15:24:30 -05:00
Zev Benjamin 24ee4a5d57 socket: Build a real Request object to send through our full stack, including middleware
One quirk here is that the Request object is built in the
message_sender worker, not Tornado.  This means that the request time
only counts time taken for the actual sending and does not account
for socket overhead.  For this reason, I've left the fake logging in
for now so we can compare the two times.

(imported from commit b0c60a3017527a328cadf11ba68166e59cf23ddf)
2013-11-12 15:24:29 -05:00
Zev Benjamin 24ae5998e5 socket: Request the status of pending requests on reconnect
This will hopefully help with the send dialog being stuck on
"sending" as well as allowing us to not show errors to the user on
reconnect.

(imported from commit 31ee889853f348e486863073dc130cdfb4e1338d)
2013-11-07 11:43:34 -05:00
Zev Benjamin 48a25211fa socket: Record the request status in redis
(imported from commit 6c3f6dc37d1abdcacf105f865ac24483717438ca)
2013-11-07 11:43:34 -05:00
Zev Benjamin 87fc182645 socket: Move `req_id` parameter to top level of protocol payload
(imported from commit 271d84a0b44a2623bec290f64a83a0423698a1ef)
2013-11-07 11:43:34 -05:00
Zev Benjamin 4595143023 socket: Switch to client ids from connection ids
Clients can only have one connection at a time, anyway, so we can
just keep track of a client id, instead.  This makes reconnections
easier.

It's a little funny to use queue ids for the client id, but we know
they should exist by the time the client is connecting and they are
guaranteed to already be unique and authenticatable.  We will also
eventually be integrating the event system and the socket code closer
anyway.

(imported from commit 1f60e06fb16d31d6c121deafd493fb304d19a6c2)
2013-11-07 11:43:34 -05:00
Zev Benjamin 63924ea742 socket: Reduce code duplication in authentication error cases
(imported from commit e7900b1374c3c0e5ea994ff315d281833e7ecdc6)
2013-11-07 11:37:00 -05:00
Zev Benjamin e0fece4082 socket: Log the transport type on the authentication line
(imported from commit 7b3ae3ab38da35cbd60aca991665d40b41a7f78f)
2013-11-07 11:31:06 -05:00
Steve Howell 70c1c31b3a Simplify callback protocol for register_json_consumer().
The register_json_consumer() function now expects its callback
function to accept a single argument, which is the payload, as
none of the callbacks cared about channel, method, and properties.

This change breaks down as follows:

    * A couple test stubs and subclasses were simplified.
    * All the consume() and consume_wrapper() functions in
      queue_processors.py were simplified.
    * Two callbacks via runtornado.py were simplified.  One
      of the callbacks was socket.respond_send_message, which
      had an additional caller, i.e. not register_json_consumer()
      calling back to it, and the caller was simplified not
      to pass None for the three removed arguments.

(imported from commit 792316e20be619458dd5036745233f37e6ffcf43)
2013-10-31 13:18:11 -04:00
Leo Franchi 9be1333c6b Log send_message times through our new socket infrastructure as well
(imported from commit 215be8f7e3d2498ed34e9fcc421498a7cfca4fbc)
2013-10-29 17:49:27 -04:00
Zev Benjamin b1eebc0b84 Deliver messages inside Tornado when running tests
This saves us from having to run queue processors while testing.

(imported from commit 927bfa497a47b34603761a148c57d82b2f34f813)
2013-10-22 18:45:11 -04:00
Zev Benjamin 3c73468ba8 Disable unsupported SockJS transports
Because our authentication system reads cookies from the initial
connection attempt, several SockJS transports can't be used.

(imported from commit 34b9571225d39072985b8223fb12c43c7235841f)
2013-10-22 18:45:11 -04:00
Zev Benjamin 5979af3a45 [manual] Add asynchronous message sender via sockjs-tornado
New dependency: sockjs-tornado

One known limitation is that we don't clean up sessions for
non-websockets transports.  This is a bug in Tornado so I'm going to
look at upgrading us to the latest version:
https://github.com/mrjoes/sockjs-tornado/issues/47

(imported from commit 31cdb7596dd5ee094ab006c31757db17dca8899b)
2013-10-22 18:45:11 -04:00