drapanjanas / pneumatic-tubes Goto Github PK
View Code? Open in Web Editor NEWWebSocket based transport of events between re-frame app and server
License: Eclipse Public License 1.0
WebSocket based transport of events between re-frame app and server
License: Eclipse Public License 1.0
I was experimenting with Sente in a re-frame app. However, Sente's api felt a bit clunky and I found I still needed to write some boilerplate/middleware for "re-framing" the messages to events. Then looked for alternatives and found your tubes, which seems to have a nice and clean real-world api. I'm using Immutant though, would you consider adding an adapter for it? Seems like it'd be relatively simple to write another websocket-handler, similar to Sente's Immutant adapter (https://github.com/ptaoussanis/sente/blob/master/src/taoensso/sente/server_adapters/immutant.clj).
I pulled down the average_number demo and would like to work with it using an interactive cider nrepl session but I couldn't really figure out exactly how to get the project going. I eventually got it running by doing lein figwheel
but I still didn't have the interactivity I was expecting.
A few more things:
Hi @drapanjanas, not sure if you're supposed to be able to chat back with the group-chat-app from the ios app but I found it confusing that I was unable to do so through the simulator. Am I missing something or has that functionality just not been implemented yet?
Hello, I'm building a web app, got confused by a situation below, would appreciate any helpful suggestions
App runs at:
http://dev.brawl.haus
on login event dispatches successfully (logged in console)
Locally it proceeds fine, however on a cloud machine it fails on server side event handle with error below
Exception in thread "async-dispatch-60" java.lang.IllegalArgumentException: No implementation of method: :close! of protocol: #'clojure.core.async.impl.protocols/Channel found for class: clojure.lang.PersistentVector
at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:568)
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:560)
at clojure.core.async.impl.protocols$fn__400$G__393__405.invoke(protocols.clj:21)
at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:1018)
at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:1014)
at pneumatic_tubes.core$receive$fn__6237.invoke(core.clj:118)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
And such happens on server start:
Exception in thread "async-dispatch-149" java.lang.ClassCastException: clojure.core.async.impl.buffers.FixedBuffer cannot
be cast to java.util.Iterator
at clojure.core.async.impl.channels.ManyToManyChannel$fn__639.invoke(channels.clj:87)
at clojure.core.async.impl.channels.ManyToManyChannel.put_BANG_(channels.clj:86)
at clojure.core.async.impl.ioc_macros$put_BANG_.invokeStatic(ioc_macros.clj:1031)
at clojure.core.async.impl.ioc_macros$put_BANG_.invoke(ioc_macros.clj:1030)
at pneumatic_tubes.core$dispatch$fn__6317$state_machine__4322__auto____6318$fn__6320.invoke(core.clj:140)
at pneumatic_tubes.core$dispatch$fn__6317$state_machine__4322__auto____6318.invoke(core.clj:139)
at clojure.core.async.impl.ioc_macros$run_state_machine.invokeStatic(ioc_macros.clj:1012)
at clojure.core.async.impl.ioc_macros$run_state_machine.invoke(ioc_macros.clj:1011)
at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:1016)
at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:1014)
at pneumatic_tubes.core$dispatch$fn__6317.invoke(core.clj:139)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Repo: https://github.com/andrewzhurov/brawl-haus
Event dispatch: https://github.com/andrewzhurov/brawl-haus/blob/master/src/cljs/brawl_haus/panels/login.cljs#L14
Tube registration: https://github.com/andrewzhurov/brawl-haus/blob/master/src/clj/brawl_haus/server.clj#L209
Modified webhook-handler: https://github.com/andrewzhurov/brawl-haus/blob/master/src/clj/brawl_haus/my_tubes.clj#L30
(only differs in arguments) (needed that on-tube-close
)
The lib is a ton of fun to play with! Event execution in context of server seems much useful
Looks like the right step we put our state into - server! No need to poke and sync, we can propagate state from truly top of our apps
Hello,
First, thanks for this library. It's an awesome accomplishment.
I'm having some issues with wrapping tubes into a Sierra component (https://github.com/stuartsierra/component)
Mainly, from reading the code, it doesn't seem like support for (tubes/create! t)
, followed by (tubes/destroy! t)
, followed by another call to (tubes/create! t)
is a supported operation. I'm noticing that the tube is still marked as :destroyed true
even after I re-create it.
What is your suggestion for stopping and then starting a tube? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.