woo

API Reference

clack-handler-woo

No packages.

woo

An asynchronous HTTP server written in Common Lisp

WOO

  • Variable *DEFAULT-BACKLOG-SIZE*
    128
  • Variable *DEFAULT-WORKER-NUM*
    nil
  • Function RUN (app &key (debug t) (port 5000) (address "127.0.0.1") listen (backlog *default-backlog-size*) fd (worker-num *default-worker-num*))
  • Function STOP (server)

Also exports

  • WOO.EV.EVENT-LOOP:*BUFFER-SIZE*
  • WOO.EV.TCP:*CONNECTION-TIMEOUT*

WOO.RESPONSE

  • Variable *EMPTY-CHUNK*
    #(48 13 10 13 10)
  • Variable *EMPTY-BYTES*
    #()
  • Variable *CRLF*
    (trivial-utf-8:string-to-utf-8-bytes (format nil "~c~c" #\return #\newline))
  • Function WRITE-SOCKET-STRING (socket string)
  • Function WRITE-SOCKET-CRLF (socket)
  • Function RESPONSE-HEADERS-BYTES (socket status headers &optional keep-alive-p)
  • Function WRITE-RESPONSE-HEADERS (socket status headers &optional keep-alive-p)
  • Function WRITE-BODY-CHUNK (socket chunk &key (start 0) (end (length chunk)))
  • Function WRITE-STRING-BODY-CHUNK (socket chunk)
  • Function FINISH-RESPONSE (socket &optional (body *empty-bytes*))

WOO.EV

No exported symbols.

Also exports

  • WOO.EV.SOCKET:CLOSE-SOCKET
  • WOO.EV.SOCKET:WITH-ASYNC-WRITING
  • WOO.EV.SOCKET:SOCKET-OPEN-P
  • WOO.EV.CONDITION:TCP-ERROR
  • WOO.EV.SOCKET:SOCKET-REMOTE-ADDR
  • WOO.EV.TCP:WITH-SOCKADDR
  • WOO.EV.EVENT-LOOP:*EVLOOP*
  • WOO.EV.SOCKET:WRITE-SOCKET-DATA
  • WOO.EV.EVENT-LOOP:*DATA-REGISTRY*
  • WOO.EV.TCP:TCP-SERVER
  • WOO.EV.SOCKET:SOCKET
  • WOO.EV.SOCKET:SOCKET-DATA
  • WOO.EV.SOCKET:SOCKET-REMOTE-PORT
  • WOO.EV.TCP:CLOSE-TCP-SERVER
  • WOO.EV.TCP:*CONNECTION-TIMEOUT*
  • WOO.EV.EVENT-LOOP:*BUFFER-SIZE*
  • WOO.EV.EVENT-LOOP:WITH-EVENT-LOOP
  • WOO.EV.CONDITION:SOCKET-CLOSED
  • WOO.EV.SOCKET:WRITE-SOCKET-BYTE

WOO.WORKER

  • Function ADD-JOB-TO-CLUSTER (cluster job)
  • Function MAKE-CLUSTER (worker-num process-fn)
  • Function STOP-CLUSTER (cluster)
  • Function KILL-CLUSTER (cluster)

WOO.QUEUE

No exported symbols.

Also exports

  • SB-CONCURRENCY:MAKE-QUEUE
  • SB-CONCURRENCY:DEQUEUE
  • SB-CONCURRENCY:ENQUEUE
  • SB-CONCURRENCY:QUEUE-EMPTY-P

WOO.EV.EVENT-LOOP

  • Variable *EVLOOP*
    nil
  • Variable *BUFFER-SIZE*
    (* 1024 64)
  • Variable *INPUT-BUFFER*
    nil
  • Variable *DATA-REGISTRY*
    nil
  • Function (setf CALLBACKS) (callbacks pointer)
  • Function CALLBACKS (pointer)
  • Function REMOVE-CALLBACKS (pointer)
  • Function DEREF-DATA-FROM-POINTER (pointer)
  • Function (setf DEREF-DATA-FROM-POINTER) (data pointer)
  • Function REMOVE-POINTER-FROM-REGISTRY (pointer)
  • Macro WITH-EVENT-LOOP ((&key enable-fork cleanup-fn) &body body)
  • Function CHECK-EVENT-LOOP-RUNNING

WOO.EV.SOCKET

  • Struct SOCKET
    WATCHERS
    LAST-ACTIVITY
    FD
    REMOTE-ADDR
    REMOTE-PORT
    DATA
    TCP-READ-CB
    READ-CB
    WRITE-CB
    OPEN-P
    BUFFER
    SENDFILE-FD
    SENDFILE-SIZE
    SENDFILE-OFFSET
  • Function SOCKET-LAST-ACTIVITY (instance)
  • Function (setf SOCKET-LAST-ACTIVITY) (value instance)
  • Function SOCKET-REMOTE-ADDR (instance)
  • Function (setf SOCKET-REMOTE-ADDR) (value instance)
  • Function SOCKET-REMOTE-PORT (instance)
  • Function (setf SOCKET-REMOTE-PORT) (value instance)
  • Function SOCKET-DATA (instance)
  • Function (setf SOCKET-DATA) (value instance)
  • Function SOCKET-READ-CB (instance)
  • Function (setf SOCKET-READ-CB) (value instance)
  • Function SOCKET-OPEN-P (instance)
  • Function (setf SOCKET-OPEN-P) (value instance)
  • Function MAKE-SOCKET (&rest initargs &key tcp-read-cb fd &allow-other-keys)
  • Function SOCKET-READ-WATCHER (socket)
  • Function SOCKET-WRITE-WATCHER (socket)
  • Function SOCKET-TIMEOUT-TIMER (socket)
  • Function CLOSE-SOCKET (socket)
  • Function CHECK-SOCKET-OPEN (socket)
  • Function WRITE-SOCKET-DATA (socket data &key (start 0) (end (length data)) (write-cb nil write-cb-specified-p))
  • Function WRITE-SOCKET-BYTE (socket byte &key (write-cb nil write-cb-specified-p))
  • Function FLUSH-BUFFER (socket)
  • Macro WITH-ASYNC-WRITING ((socket &key write-cb force-streaming) &body body)
  • Function SEND-STATIC-FILE (socket fd size)

WOO.EV.TCP

  • Variable *CONNECTION-TIMEOUT*
    (coerce (* 15 60) 'double-float)
  • Macro WITH-SOCKADDR (&body body)
  • Function START-LISTENING-SOCKET (socket)
  • Function TCP-SERVER (address-port read-cb &key connect-cb (backlog 128) fd (sockopt +so-reuseaddr+))
  • Function CLOSE-TCP-SERVER (watcher)

WOO.EV.CONDITION

  • Condition WOO-ERROR  (ERROR)
  • Condition TCP-ERROR  (WOO-ERROR)
  • Condition SOCKET-CLOSED  (TCP-ERROR)
  • Condition OS-ERROR  (WOO-ERROR)

WOO.EV.UTIL

  • Function IO-FD (io)
  • Macro DEFINE-C-CALLBACK (name return-val (&rest args) &body body)
    Define a top-level function with the given and also define a C callback that calls the function directly. The idea is that CFFI callbacks aren't directly callable/debuggable, but it's obnoxious to have to define and callback *and* a function right next to each other.

WOO.LLSOCKET

  • Function SO-REUSEPORT-AVAILABLE-P
  • Variable +AF-UNIX+
    1
  • Variable +AF-INET+
    2
  • Variable +AF-INET6+
    10
  • Variable +SOCK-STREAM+
    1
  • Variable +SOCK-DGRAM+
    2
  • Variable +SOCK-RAW+
    3
  • Variable +SOCK-RDM+
    4
  • Variable +SOCK-SEQPACKET+
    5
  • Variable +SOCK-CLOEXEC+
    524288
  • Variable +SOCK-NONBLOCK+
    2048
  • Variable +SO-DEBUG+
    1
  • Variable +SO-ACCEPTCONN+
    30
  • Variable +SO-REUSEADDR+
    2
  • Variable +SO-REUSEPORT+
    15
  • Variable +SO-KEEPALIVE+
    9
  • Variable +SO-DONTROUTE+
    5
  • Variable +SO-BROADCAST+
    6
  • Variable +SO-LINGER+
    13
  • Variable +SO-OOBINLINE+
    10
  • Variable +SO-SNDBUF+
    7
  • Variable +SO-RCVBUF+
    8
  • Variable +SO-SNDLOWAT+
    19
  • Variable +SO-RCVTIMEO+
    20
  • Variable +SO-ERROR+
    4
  • Variable +SO-TYPE+
    3
  • Variable +SOMAXCONN+
    128
  • Variable +SOL-SOCKET+
    1
    get/setsockopt socket level constant.
  • Variable +SOL-IP+
    0
    get/setsockopt IP level constant.
  • Variable +SOL-RAW+
    255
    get/setsockopt raw level constant.
  • Variable +IPPROTO-IP+
    0
  • Variable +IPPROTO-IPV6+
    41
  • Variable +IPPROTO-ICMP+
    1
  • Variable +IPPROTO-ICMPV6+
    58
  • Variable +IPPROTO-RAW+
    255
  • Variable +IPPROTO-TCP+
    6
  • Variable +IPPROTO-UDP+
    17
  • Variable +INADDR-ANY+
    0
  • Variable +INADDR-BROADCAST+
    4294967295
  • Variable +INADDR-NONE+
    4294967295
  • Variable +IN-LOOPBACKNET+
    127
  • Variable +INADDR-LOOPBACK+
    2130706433
  • Variable +INADDR-UNSPEC-GROUP+
    3758096384
  • Variable +INADDR-ALLHOSTS-GROUP+
    3758096385
  • Variable +INADDR-ALLRTRS-GROUP+
    3758096386
  • Variable +INADDR-MAX-LOCAL-GROUP+
    3758096639
  • Variable +IP-HDRINCL+
    3
  • Variable +IP-RECVERR+
    11
  • Variable +AI-PASSIVE+
    1
  • Variable +AI-CANONNAME+
    2
  • Variable +AI-NUMERICHOST+
    4
  • Variable +AI-V4MAPPED+
    8
  • Variable +AI-ALL+
    16
  • Variable +AI-ADDRCONFIG+
    32
  • Cffi-Type SOCKLEN-T
  • Cffi-Struct SOCKADDR
  • Cffi-Struct SOCKADDR-STORAGE
  • Cffi-Struct SOCKADDR-IN
  • Cffi-Struct SOCKADDR-IN6
  • Cffi-Struct ADDRINFO
  • Cffi-Struct SOCKADDR-UN
  • Variable +MSG-OOB+
    1
  • Variable +MSG-PEEK+
    2
  • Variable +MSG-DONTROUTE+
    4
  • Variable +MSG-EOR+
    128
  • Variable +MSG-TRUNC+
    32
  • Variable +MSG-CTRUNC+
    8
  • Variable +MSG-WAITALL+
    256
  • Cffi-Struct MSGHDR
  • Cffi-Struct CMSGHDR
  • Variable +SHUT-RD+
    0
  • Variable +SHUT-WR+
    1
  • Variable +SHUT-RDWR+
    2
  • Cffi-Function ACCEPT
  • Function ACCEPT (socket address addrlen)
  • Cffi-Function ACCEPT4
  • Function ACCEPT4 (socket address addrlen flags)
  • Cffi-Function BIND
  • Function BIND (socket address addrlen)
  • Cffi-Function CONNECT
  • Function CONNECT (socket address addrlen)
  • Cffi-Function GETPEERNAME
  • Function GETPEERNAME (socket address addrlen)
  • Cffi-Function GETSOCKNAME
  • Function GETSOCKNAME (socket address addrlen)
  • Cffi-Function GETSOCKOPT
  • Function GETSOCKOPT (socket level optname optval optlen)
  • Cffi-Function INET-NTOA
  • Function INET-NTOA (addr)
  • Cffi-Function INET-NTOP
  • Function INET-NTOP (af src dst size)
  • Cffi-Function LISTEN
  • Function LISTEN (socket backlog)
  • Cffi-Function RECVFROM
  • Function RECVFROM (socket buffer length flags address addrlen)
  • Cffi-Function RECVMSG
  • Function RECVMSG (socket message flags)
  • Cffi-Function SENDTO
  • Function SENDTO (socket buffer length flags destaddr destlen)
  • Cffi-Function SENDMSG
  • Function SENDMSG (socket message flags)
  • Cffi-Function SETSOCKOPT
  • Function SETSOCKOPT (socket level optname optval optlen)
  • Cffi-Function SHUTDOWN
  • Function SHUTDOWN (socket how)
  • Cffi-Function SOCKET
  • Function SOCKET (domain type protocol)
  • Cffi-Function SOCKETPAIR
  • Function SOCKETPAIR (domain type protocol fd)
  • Cffi-Function GETADDRINFO
  • Function GETADDRINFO (node service hints res)
  • Cffi-Function FREEADDRINFO
  • Function FREEADDRINFO (res)

WOO.SYSCALL

  • Function OPEN (path &optional (flags +o-rdonly+) (mode 438))
  • Function CLOSE (fd)
  • Function WRITE (fd buf count)
  • Function READ (fd buf count)
  • Cffi-Function KILL
  • Function KILL (pid sig)
  • Cffi-Function CHMOD
  • Function CHMOD (path mode)
  • Variable EWOULDBLOCK
    35
  • Variable EPIPE
    32
  • Variable EINTR
    4
  • Variable EPROTO
    100
  • Variable ECONNABORTED
    53
  • Variable ECONNREFUSED
    61
  • Variable ECONNRESET
    54
  • Variable ENOTCONN
    57
  • Variable EAGAIN
    11
  • Function SET-FD-NONBLOCK (fd enabled)
  • Cffi-Function FORK
  • Function FORK
  • Cffi-Function MEMSET
  • Function MEMSET (buffer value count)
  • Function BZERO (buffer count)
  • Function ERRNO
  • Cffi-Function GETPID
  • Function GETPID
  • Cffi-Function GETPPID
  • Function GETPPID
  • Function SENDFILE (infd outfd offset nbytes)

WOO.SIGNAL

  • Function MAKE-SIGNAL-WATCHERS
  • Function START-SIGNAL-WATCHERS (evloop watchers)
  • Function STOP-SIGNAL-WATCHERS (evloop watchers)

WOO.SPECIALS

  • Variable *APP*
    nil
  • Variable *DEBUG*
    nil
  • Function DEFAULT-THREAD-BINDINGS
  • Variable *LISTENER*
    nil
  • Variable *CLUSTER*
    nil

woo-test

No packages.