Fork me on GitHub
#clojure-uk
<
2020-04-09
>
dharrigan05:04:33

Good Morning!

Jakob Durstberger06:04:45

Good morning and happy pre-friday!

Gulli07:04:45

Morning. 5 day weekend for me starting today :)

👍 8
dharrigan07:04:24

All the days have blended into one

guy07:04:26

Morning!

Gulli08:04:04

@dharrigan Indeed, especially when you have two under two

dharrigan08:04:32

Fun and games!

dharrigan08:04:55

(merge every-day today-and-every-day)

4
dominicm08:04:32

I'm taking a 5 day weekend too

dominicm08:04:40

I'm still sat in bed and it's great

🙂 4
dharrigan08:04:03

I'm taking the opportunity to do a bit more clojure self-learning

dharrigan08:04:08

by writing a little application

rhinocratic08:04:04

Trying to use my time for study, too. Attempting to avoid my usual ADHD behaviour of getting started on something then dropping it because I've seen something else that seems shinier.

4
guy08:04:58

Its really hard yeah, i have the same but with starting mini projects haha

rhinocratic08:04:48

My GitHub used to be a mini-project graveyard until I cleared it out.

😄 4
thomas08:04:05

I am rather good at starting things, not as good as finishing things.

folcon08:04:08

Having some minor success with this at the moment =)… But yea it’s hard…

guy08:04:17

I've got a project idea that I keep coming back to at the moment which is nice but I also feel a bit guilty when i'm not working on it too haha

dharrigan08:04:27

I have trouble following through too. I think I've a too critical inner voice.

zyxmn08:04:27

Good morning , damn I should have taken today off

zyxmn08:04:58

Wish I didn't read this channel today , jealous

😄 12
alexlynham09:04:41

morning

👋 8
Ben Hammond13:04:10

I'm trying to get my head round WebSockets on the Server side (jetty) The simple onTextMessage callback provides no context about which connection sent the message https://github.com/eclipse/jetty.project/blob/923ec38adf64d1d68da6a91902f5925a8bffb7d9/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/events/EventDriver.java#L65 how do people normally corrrelate incoming messages with a specific clent connecttion?

Ben Hammond13:04:37

Hmmm might cross-post onto #pedestal

mccraigmccraig13:04:58

does the instance implementing EventDriverhold the client context @ben.hammond? (asking from a pov including zero-knowledge of jetty websox impl)

Wes Hall13:04:45

@ben.hammond My experience with websocket stuff (which, I would admit, is not extensive), is that you essentially have to manage state like this yourself. I am not very familiar with the jetty implementation but this interface has a "getSession" method which suggests to me 2 things 1) they are going to give you a bit of support with session management, at least a map-like thing to store stuff in and 2) there will be a separate instance of EventDriver for each connection so the context is essentially the EventDriver instance.

Ben Hammond16:04:42

which should make it fairly simple to wire up

Wes Hall13:04:18

I would imagine (without looking at the docs), that you probably need to supply jetty with some kind of factory for creating instances of these things, and it will create an instance for each connection.

mccraigmccraig14:04:31

perhaps not very helpful, but aleph has a nice websocket interface - you get a duplex manifold stream - take from the stream to get inbound packets and put to the stream to write back to the client

Ben Hammond15:04:51

yeah I've got pedestal/jetty at the moment

Ben Hammond15:04:01

mainly because I'm not a big fan of the manifold threading model

Ben Hammond15:04:15

I'd rather have a proper stack trace

Ben Hammond15:04:36

than this 'every function call runs as its own executor task` model where the Exception stack trace tells you almost nothing

mccraigmccraig15:04:49

i get that... i have a solution to it too, although i haven't managed to get my solution in to production yet...

mccraigmccraig15:04:17

mostly because it hasn't proven to be a great problem... although i would like per-operation logs

mccraigmccraig15:04:58

on the advantages side, promises+streams has proven to be a great model for controlling complex operations

Wes Hall14:04:19

I'm so out of date with the JEE stuff now it's depressing but it looks like they have some kind of web socket servlet thing wrapping all this.

Ben Hammond15:04:18

yeah the getSession() seems tto just be the original value from onWebSocketConnet that has been hung on to and It Just Works