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

Readme incomplete and outdated #25

Closed
vspinu opened this issue Oct 15, 2017 · 4 comments
Closed

Readme incomplete and outdated #25

vspinu opened this issue Oct 15, 2017 · 4 comments

Comments

@vspinu
Copy link

vspinu commented Oct 15, 2017

Some parts of the docs are outdated. For instance the decoder/encoder examples don't work as encode* now accepts 3 arguments. send in the example should be send!. There is also no such thing as link.core/channel-option anymore.

The readme also doesn't contain a complete working example. I cannot figure out how to make it work. For instance the following doesn't work as the send! in the last line seem to have no effect:

  (def custom-codec
    (codec/frame
      (codec/byte)
      (codec/string :encoding :utf8 :prefix (codec/uint16))))
  
  (def echo-handler
    (link/create-handler
      (link/on-message [ch msg]
                       (link/send! ch msg))))

  (def print-handler
    (link/create-handler
      (link/on-message [ch msg]
                       (println "msg:" msg))))

  (def srv (tcp/tcp-server 8081 [(codec/netty-encoder custom-codec)
                                 (codec/netty-decoder custom-codec)
                                 {:handler echo-handler}]
                           :options {:so-reuseaddr true}))

  (def client-factory
    (tcp/tcp-client-factory [(codec/netty-encoder custom-codec)
                             (codec/netty-decoder custom-codec)
                             {:handler print-handler}]))

  (def cl (tcp/tcp-client client-factory "localhost" 8081))
  (link/send! cl [1 "blabla"]) ;; <- nothing happens after this
@vspinu
Copy link
Author

vspinu commented Oct 15, 2017

It actually started working, so nevermind about my issue. Leaving this open as a documentation issue.

@sunng87
Copy link
Contributor

sunng87 commented Oct 15, 2017 via email

@sunng87
Copy link
Contributor

sunng87 commented Oct 19, 2017

Fixed

@sunng87 sunng87 closed this as completed Oct 19, 2017
@vspinu
Copy link
Author

vspinu commented Oct 19, 2017

Thanks!

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

No branches or pull requests

2 participants