Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make channel socket available in event-msg-handler #69

Closed

Conversation

hugoduncan
Copy link
Collaborator

This is a provisional pull-request that makes the changes proposed in #68

ptaoussanis and others added 12 commits July 21, 2014 13:01
Use `ring-defaults` middleware (danielsz)
To allow a message handler to be used without reference to a singleton
channel socket instance, pass channel-socket information to the
event-msg-handler function.

On the server side, the :channel-socket key is added to the event map
passed as the first argument, and the ch-recv argument is removed (as it
is now available under the :channel-socket.

On the client side, the event-msg-handler signature is changed to match
the server side more closely, taking a single map argument that has
:event and :channel-socket keys.

The new signature is used by the new start-message-router! functions.

The old signature is still used by the start-chsk-router-loop!
functions.
@ptaoussanis
Copy link
Member

Hi Hugo, thanks for this!

Sorry for not replying at the other thread, haven't had an opportunity to look over the issue properly yet.

Have been batching some Sente work which I'm hoping to (finally) get to tomorrow. Will come back to you shortly.

Cheers! :-)

ptaoussanis added a commit that referenced this pull request Sep 1, 2014
…, [#69] (@hugoduncan), more

Completely refactored Sente's client<->server data handling for:
  * Greater consistency, simplicity, robustness.
  * Increased efficiency (smaller cb ids, leaner cb wrapping format).
  * Pluggable serialization.

The pluggable serialization brings optional support for Transit, incl.
JSON and MessagePack over Transit (thanks to @ckarlsen for getting the ball
rolling on this!).

An early, experimental FlexiPacker is provided that allows per-payload
format selection and simple heuristic-based auto format selection for highly
efficient client<->server data comms in a wide range of use cases. This will
likely become Sente's standard (if not default) package format in future.

Other changes in this squashed commit include:
  * General code review + clean-up.
  * Improved logging.
  * A new client-side `chsk-destroy!` API fn.
  * Improved client+server router support for component-style configs
    (thanks to @hugoduncan for this!): server+client side routers now
    both receive `event-msg`s, and those `event-msg`s contain more
    useful goodies.
  * Client-side router now traps+logs errors like the server-side router.
  * Improve reference example's compatibility with LightTable.
@ptaoussanis
Copy link
Member

Closing, changes merged manually in v1.0.0-SNAPSHOT.

@ptaoussanis ptaoussanis closed this Sep 1, 2014
ptaoussanis added a commit that referenced this pull request Sep 1, 2014
…, [#69] (@hugoduncan), more

Completely refactored Sente's client<->server data handling for:
  * Greater consistency, simplicity, robustness.
  * Increased efficiency (smaller cb ids, leaner cb wrapping format).
  * Pluggable serialization.

The pluggable serialization brings optional support for Transit, incl.
JSON and MessagePack over Transit (thanks to @ckarlsen for getting the ball
rolling on this!).

An early, experimental FlexiPacker is provided that allows per-payload
format selection and simple heuristic-based auto format selection for highly
efficient client<->server data comms in a wide range of use cases. This will
likely become Sente's standard (if not default) package format in future.

Other changes in this squashed commit include:
  * General code review + clean-up.
  * Improved logging.
  * A new client-side `chsk-destroy!` API fn.
  * Improved client+server router support for component-style configs
    (thanks to @hugoduncan for this!): server+client side routers now
    both receive `event-msg`s, and those `event-msg`s contain more
    useful goodies.
  * Client-side router now traps+logs errors like the server-side router.
  * Improve reference example's compatibility with LightTable.
ptaoussanis added a commit that referenced this pull request Sep 2, 2014
…, [#69] (@hugoduncan), more

Completely refactored Sente's client<->server data handling for:
  * Greater consistency, simplicity, robustness.
  * Increased efficiency (smaller cb ids, leaner cb wrapping format).
  * Pluggable serialization.

The pluggable serialization brings optional support for Transit, incl.
JSON and MessagePack over Transit (thanks to @ckarlsen for getting the ball
rolling on this!).

An early, experimental FlexiPacker is provided that allows per-payload
format selection and simple heuristic-based auto format selection for highly
efficient client<->server data comms in a wide range of use cases. This will
likely become Sente's standard (if not default) package format in future.

Other changes in this squashed commit include:
  * General code review + clean-up.
  * Improved logging.
  * A new client-side `chsk-destroy!` API fn.
  * Improved client+server router support for component-style configs
    (thanks to @hugoduncan for this!): server+client side routers now
    both receive `event-msg`s, and those `event-msg`s contain more
    useful goodies.
  * Client-side router now traps+logs errors like the server-side router.
  * Improve reference example's compatibility with LightTable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants