Fork me on GitHub
#yada
<
2016-01-26
>
edwardk17:01:49

Has anybody used yada with tomcat instead of aleph?

edwardk17:01:21

I have been experimenting with this and I have found my :servlet-context is going missing from the request.

imre17:01:38

hey @edwardk as far as I know yada has a hard dependency on aleph for the moment

jethroksy17:01:45

@imre i think that's incorrect

edwardk17:01:46

hi @imre, i know only it is only targeted on aleph, that's why i would call it an experiment... it works for the most part

jethroksy17:01:34

I don't think it even pulls in aleph as a dependency

imre17:01:10

apologies, you are right

edwardk17:01:19

no but as i understand it's developed against aleph

imre17:01:28

you learn something new every day simple_smile

jethroksy17:01:29

yes, because it is built on the manifold library

jethroksy17:01:54

aleph is also built against that, so it just happens to be easier to coordinate the two libraries

jethroksy17:01:28

you can use manifold's functions to coerce your streams into compatible stuff, like channels

edwardk17:01:01

it works out of the box with aleph but i have had to jump through a few hoops to fit it to the lein-ring plugin and tomcat

jethroksy17:01:47

is lein-ring using jetty?

edwardk17:01:09

just trying to understand what happens to the original ring request really.

edwardk17:01:30

yes, it will fire up jetty

edwardk17:01:46

but you can also build a war that can be deployed on tomcat

edwardk17:01:37

unfortunately i'm stuck with tomcat for the moment and i need to use some elements from the tomcat servlet-context

edwardk17:01:45

it's a bit ugly tbh, but i was keen to play with yada.. not sure at this point if the amount of hacking needed is too great

jethroksy17:01:56

i'm not familiar with tomcat unfortunately

jethroksy17:01:09

but afaik aleph is pretty much the only server to use with yada right now

jethroksy17:01:23

you could use catacumba, but they have some functionality overlaps

jethroksy17:01:36

the selling point of yada is full async all the way down

jethroksy17:01:42

I think you lose that with jetty/tomcat

edwardk17:01:45

yes, very true. i am quite honestly trying to get some hands-on experience with yada despite the fact that stack i am required to use defeats much of the advantage

edwardk17:01:14

although it is still very nice to define the resources once and get the swagger almost for free

jethroksy17:01:58

I quite like the resource model as well

jethroksy17:01:41

malcolm mentioned that yada isn't quite production ready yet

jethroksy17:01:45

its still in its early stages

jethroksy17:01:02

i'm sure as it matures compatibility issues would be ironed out, but I doubt that's priority

jethroksy17:01:17

but because everything is data in yada I believe its relatively simple to introspect the ring handlers generated from your resource

jethroksy17:01:08

Here's an example

edwardk18:01:43

@jethroksy: thanks for that, i've figured it out now

edwardk18:01:32

the value passed into the :response function contains a :request element

edwardk18:01:38

:servlet-context is in there

edwardk18:01:43

:thumbsup:

malcolmsparks21:01:13

The dependency on aleph isn't ideological or anything, it's just that I have to manage my time carefully and it's quicker right now to target one async server.

malcolmsparks21:01:49

Also, yada is no longer in its early stages, it's a proper beta now, nothing substantial will change between now and the official 1.1 release in a few weeks time.

malcolmsparks21:01:10

After 1.1 I will gather feedback from users about priorities and definitely look into other web server options - most Java webservers have Servlet async support, and pedestal has made good use of that. I also want to support Immutant. Doing all this will slow down yada development but I feel it will be better to support more deployment options in the future.

malcolmsparks21:01:50

btw. the idiomatic way to serve resources now is (yada dir).

malcolmsparks21:01:53

I'm considering renaming the 'request-context' ctx to environment env, Om Next does this.

malcolmsparks21:01:09

Wonder if anyone has any opinion on this - it won't change any functionality

malcolmsparks21:01:39

@edwardk: I'd be very interested to know how your experiment goes