Fork me on GitHub
#off-topic
<
2019-09-18
>
kelvin09:09:37

Interesting new programming language > https://www.youtube.com/watch?v=gCWtkvDQ2ZI

👀 4
👍 8
Vincent Cantin13:09:24

it feels like pretty clojure-macro-able to me 🙂

jeroenvandijk14:09:29

Did anyone happen to try and use the Github package registry to push a jar of a vendor (in my case the datomic-pro jar) to their private repo?

jeroenvandijk14:09:05

I've also asked in #datomic but this is probably a broader issue

gerred14:09:06

no but I'm very familiar with github package registry, what's the question?

jeroenvandijk15:09:32

@U05509S91 i've pushed the datomic-pro jar to a private repo with mvn deploy. This "works", but I can't get leiningen to pull with the normal coordinates

jeroenvandijk15:09:50

I have been able to pull a different library with the same credentials (https://github.com/yi-jiayu/clj-left-pad/packages/18529)

jeroenvandijk15:09:17

So i'm thinking maybe there is something wrong with the pom.xml . I don't know how to debug it

jeroenvandijk15:09:01

it comes out a bit differently it seems (i'm trying to pull it as com.datomic/datomic-pro)

sova-soars-the-sora20:09:37

Clear Skys by Amon Tobin is a dope song.

avi20:09:31

💯 for an actually-off-topic message 🙃

seancorfield20:09:44

Almost anything by Amon Tobin is dope!

seancorfield20:09:29

(there's a #music channel BTW)

dominicm20:09:23

Can anyone point me at a channel based web server? Something to the effect of "receive request. Parse event from request. Fire event. Await result of event. Generate response". The semantic of putting the event on a queue is quite important here.

robertfw21:09:01

@dominicm I don't have anything to suggest - we have a very channel based/async driven web server that is built on top of ring, but would be interested to hear if you find anything, I'd love to take a look at some other code

dominicm06:09:54

I appreciate that you might not be able to talk about this too much. But what are you sending the events too? What's listening to the channel? Also, how much code is generally involved in creating each event?

robertfw17:09:39

So our current system isn't a unified framework - it just uses plenty of go blocks/channels, our system has plenty of API calls to external systems, db calls etc, so we hand off anything blocking to a threadpool and then park our logical threads. However I've prototyped a more coherent system that sounds more like what you are aiming at - when requests hit the system, they have some minimal initial processing and are then placed into an a/pub. There are then "processors" which subscribe to the pub and listen for topics. Caveat - almost entirely untested prototype - but it was fairly straightforward to write a macro to handle all of the plumbing, so writing processors is just a matter of specifying what input topics to listen to for a given processing function.

dominicm17:09:05

This is exactly what I'm thinking about, yep

dominicm17:09:01

1 tip: meander looks fantastic for that initial processing 2 questions: A. How do you handle state in handlers? I'm trying very hard to think about this. B. What drove you to come up with this?

robertfw17:09:54

A - I don't have any complex handlers mimicing our production code written up in the new system yet, but I don't suspect it would be any different to your average clojure code.

robertfw17:09:09

B - We wanted to see if we could come up with a more linear code path for requests - currently it's a fairly typical nested route of calls, e.g., handler calls some logic function which calls some sub routines, which return to the logic function, which returns to the handler, which returns a response. with the event based system it's a linear path, which could be easier to reason about - but we're still not positive on it

robertfw17:09:50

Meander looks quite interesting, thanks

robertfw19:09:34

What are you looking to build?

dominicm19:09:28

I'm trying to decouple state from my web handlers. The intention is that people writing web handlers have a tendency to not care about the "how" of creating a user (e.g. postgres db or whatever) it just wants to call into a domain function and have it work. You could either encapsulate the "domain" into some opaque object blob, or you could communicate using data and leave interpretation and state management up to something else.

dominicm19:09:09

I have some workflow enhancements that will naturally flow out of this. For example, if the result of events are data, they can be spec'd. Then you can generate the variations of those responses, and open up a bunch of browser tabs to ensure that they look correct while working on them.

dominicm19:09:49

e.g. does role XYZ overflow the container it's in. Or, what does the UI look like if you try and access it as an unauthorized user? Things like that.

robertfw21:09:40

Yeah, my prototype includes assigning specs to event types. Each event processor also specifies what events it might produce, and the engine can then do verification of return types (or verify that the processor is expected to not return an event). Reducing the amount of state is also something I've been wondering - right now we end up having to pass around some blob of required components, which isn't great

robertfw21:09:23

I've been wanting to get back onto it to get a more fully fledged system, looking at how our current logic would map over, but...the usual story, other priorities raise their head

dominicm21:09:21

The giant blob of dependencies has bitten me many times. I did use an integrant system which specified exact dependencies for everything, but it was declared too verbose. I need to rethink things there a little too, in order to combine it with the event system. But I own the event system, so I can shift it as needed.

dominicm21:09:42

I think that there's only a handful of use cases you need to cover: - integration tests: you can share a big map of dependencies here. Integration tests inherently don't fit in your brain. They aren't part of something simple. Add additional subscribers in order to peek into the inner workings. - unit tests: just orchestrate the event handlers you need into a new set. This should be easy (if it isn't, then we are doing something wrong) Both of these are parallel friendly too. As the event system won't be a place.

robertfw21:09:36

Depending on what you are needing / your level of comfort, it should be fairly straight forward to assemble what you need using async ring requests and core.async

lilactown21:09:55

are you asking for a concrete implementation of a service that uses that pattern, or a web server framework that encourages that pattern?

dominicm06:09:43

Anything really :) even a blog post describing it and it's trade offs