Hello list,
I'm trying to get Clack (http://clacklisp.org/) running on Google App Engine which means doing a Java Servlets back-end. Clack expects a :RAW-BODY request header that is an input stream, and the HTTPServletRequest object I receive from the Jetty web server inherits a getReader() method (for a character stream) and a getInputStream() method (for a binary stream).
Looking at the "reference implementation" (i.e. Hunchentoot), it creates a FLEXI-STREAM so that any HTTP "Content-Length" header can be used to set the bound on the stream. So based on that, and an IRC chat with Mark E., and some scratch code, I've come up with this to create a FLEXI-STREAM from the HTTPServletRequest:
(defconstant +latin-1+ (make-external-format :latin1 :eol-style :lf) "A FLEXI-STREAMS external format used for `faithful' input and output of binary data (via hunchentoot/specials.lisp).")
(defun make-stream-for-request (req content-length) "Construct a Lisp input flexi-stream from the binary stream provided by the HTTPServletRequest. Set the bound of the stream to the value of the Content-Length header, if any." (let* ((java-stream (#"getInputStream" req)) (lisp-stream (jss:new :|lisp.Stream| (jss:get-java-field :|lisp.Symbol| "SYSTEM_STREAM") ; structureClass java-stream '(unsigned-byte 8)))) ; elementType (make-flexi-stream lisp-stream :external-format +latin-1+ :bound content-length)))
We agreed that there's not much documentation around this, hence this email.
Cheers,
John :^P
On 2015/11/20 23:24, Anton Vodonosov wrote:
John, don't forget to publish your results when you have clack working with ABCL
Note that Clack *does* currently seem to work with ABCL, at least [the simple test on the clack home page][1]. It wasn't immediately obvious how to run a clack test suite as
(asdf:test-system :clack)
doesn't seem to do anything.
John is trying to get clack to run in the Google App Engine, which is a decidedly non-standard JVM. Go John!
21.11.2015, 13:19, "Mark Evenson" evenson@panix.com:
On 2015/11/20 23:24, Anton Vodonosov wrote:
John, don't forget to publish your results when you have clack working with ABCL
Note that Clack *does* currently seem to work with ABCL, at least [the simple test on the clack home page][1].
Ah, yes, I meant to say "clack working with GAE + ABCL"
Is GAE still relevant today? I'm curious. Getting Portofino to run on GAE was a bit painful and in the end nobody expressed interest in it.
On Sat, Nov 21, 2015 at 10:12 PM, Anton Vodonosov avodonosov@yandex.ru wrote:
21.11.2015, 13:19, "Mark Evenson" evenson@panix.com:
On 2015/11/20 23:24, Anton Vodonosov wrote:
John, don't forget to publish your results when you have clack working
with ABCL
Note that Clack *does* currently seem to work with ABCL, at least [the simple test on the clack home page][1].
Ah, yes, I meant to say "clack working with GAE + ABCL"
App Engine works for me as a one-man band because I'm comfortable with the constraints and I like the "zero admin" aspect and the array of services available. In the medium term it might go away; the fact that Google seem reluctant to move it to Java 8 suggests that it isn't exactly strategic for them. I'd be interested to know how many others might use ABCL+Clack on GAE, but if that number is zero it wouldn't bother me. :)
On 22 November 2015 at 13:57, Alessio Stalla alessiostalla@gmail.com wrote:
Is GAE still relevant today? I'm curious. Getting Portofino to run on GAE was a bit painful and in the end nobody expressed interest in it.
On Sat, Nov 21, 2015 at 10:12 PM, Anton Vodonosov avodonosov@yandex.ru wrote:
21.11.2015, 13:19, "Mark Evenson" evenson@panix.com:
On 2015/11/20 23:24, Anton Vodonosov wrote:
John, don't forget to publish your results when you have clack
working with ABCL
Note that Clack *does* currently seem to work with ABCL, at least [the simple test on the clack home page][1].
Ah, yes, I meant to say "clack working with GAE + ABCL"
As a follow-up, Ludovic Champenois () posted at the end of May[1] that Google will deploy Java 8 for GAE when they feel the sandbox is secure enough; he reiterates this in a recent presentation at Devoxx 2015 in Belgium[2]. In the presentation he describes how GAE can deliver apps based on a microservices architecture. The general impression I get is that GAE isn't dying and that Google at least still consider it relevant.
[1] https://groups.google.com/d/msg/google-appengine/8y80sEhr7Rc/66WnFoBvL3AJ [2] https://www.youtube.com/watch?v=aKUlu9-psZo
On 23 November 2015 at 17:36, John Pallister john@synchromesh.com wrote:
App Engine works for me as a one-man band because I'm comfortable with the constraints and I like the "zero admin" aspect and the array of services available. In the medium term it might go away; the fact that Google seem reluctant to move it to Java 8 suggests that it isn't exactly strategic for them. I'd be interested to know how many others might use ABCL+Clack on GAE, but if that number is zero it wouldn't bother me. :)
On 22 November 2015 at 13:57, Alessio Stalla alessiostalla@gmail.com wrote:
Is GAE still relevant today? I'm curious. Getting Portofino to run on GAE was a bit painful and in the end nobody expressed interest in it.
On Sat, Nov 21, 2015 at 10:12 PM, Anton Vodonosov avodonosov@yandex.ru wrote:
21.11.2015, 13:19, "Mark Evenson" evenson@panix.com:
On 2015/11/20 23:24, Anton Vodonosov wrote:
John, don't forget to publish your results when you have clack
working with ABCL
Note that Clack *does* currently seem to work with ABCL, at least [the simple test on the clack home page][1].
Ah, yes, I meant to say "clack working with GAE + ABCL"
armedbear-devel@common-lisp.net