Ported to Chicken 5
This commit is contained in:
parent
4680d25561
commit
324324c4a9
|
@ -1,8 +0,0 @@
|
||||||
;; -*- Scheme -*-
|
|
||||||
|
|
||||||
((synopsis "Server-Sent Events module for Awful")
|
|
||||||
(author "Arthur Maciel")
|
|
||||||
(category web)
|
|
||||||
(license "BSD")
|
|
||||||
(depends awful spiffy intarweb)
|
|
||||||
(test-depends test server-test uri-common http-client))
|
|
|
@ -1,9 +0,0 @@
|
||||||
;; -*- Scheme -*-
|
|
||||||
|
|
||||||
(compile -s -O2 awful-sse.scm -j awful-sse)
|
|
||||||
(compile -s -O2 awful-sse.import.scm)
|
|
||||||
|
|
||||||
(install-extension
|
|
||||||
'awful-sse
|
|
||||||
'("awful-sse.so" "awful-sse.import.so")
|
|
||||||
'((version "0.1")))
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
;; -*- mode: scheme -*-
|
||||||
|
((author "Arthur Maciel")
|
||||||
|
(synopsis "Server-Sent Events module for Awful")
|
||||||
|
(category web)
|
||||||
|
(license "BSD")
|
||||||
|
(dependencies awful spiffy intarweb)
|
||||||
|
(test-dependencies test server-test uri-common http-client)
|
||||||
|
(components
|
||||||
|
(extension awful.sse)))
|
|
@ -24,12 +24,16 @@
|
||||||
;; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
;; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
(module awful-sse
|
(module (awful sse)
|
||||||
|
|
||||||
(define-page/sse send-sse-data send-sse-retry)
|
(define-page/sse send-sse-data send-sse-retry)
|
||||||
|
|
||||||
(import scheme chicken data-structures extras posix)
|
(import scheme
|
||||||
(use awful spiffy intarweb)
|
(chicken base)
|
||||||
|
(chicken keyword)
|
||||||
|
(chicken string)
|
||||||
|
;;data-structures extras posix
|
||||||
|
awful spiffy intarweb)
|
||||||
|
|
||||||
(define (add-sse-resource! sse-path sse-proc vhost-root-path client-path)
|
(define (add-sse-resource! sse-path sse-proc vhost-root-path client-path)
|
||||||
(add-resource! sse-path
|
(add-resource! sse-path
|
||||||
|
@ -48,7 +52,8 @@
|
||||||
(write-logged-response)
|
(write-logged-response)
|
||||||
(sse-proc))))
|
(sse-proc))))
|
||||||
(redirect-to client-path))))
|
(redirect-to client-path))))
|
||||||
'GET))
|
'GET
|
||||||
|
#f))
|
||||||
|
|
||||||
(define (define-page/sse path contents sse-path sse-proc #!rest rest)
|
(define (define-page/sse path contents sse-path sse-proc #!rest rest)
|
||||||
(apply define-page (append (list path contents) rest))
|
(apply define-page (append (list path contents) rest))
|
|
@ -1,4 +1,4 @@
|
||||||
(use awful-sse)
|
(import (awful sse))
|
||||||
|
|
||||||
(define (sse-proc)
|
(define (sse-proc)
|
||||||
(send-sse-data "sse"))
|
(send-sse-data "sse"))
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
(use awful http-client intarweb uri-common server-test test)
|
(import (chicken base)
|
||||||
|
(chicken io)
|
||||||
|
awful http-client intarweb uri-common server-test test)
|
||||||
|
|
||||||
(awful-apps (list "client.scm"))
|
(awful-apps (list "client.scm"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue