Add `:server` option to `start-player`
author |
Steve Losh <steve@stevelosh.com> |
date |
Wed, 14 Sep 2016 15:22:18 +0000 |
parents |
4a40973635ae
|
children |
6a94205a7e4f
|
branches/tags |
(none) |
files |
docs/03-reference.markdown docs/04-changelog.markdown src/ggp.lisp |
Changes
--- a/docs/03-reference.markdown Fri Jul 22 16:22:01 2016 +0000
+++ b/docs/03-reference.markdown Wed Sep 14 15:22:18 2016 +0000
@@ -153,10 +153,14 @@
### `START-PLAYER` (function)
- (START-PLAYER PLAYER)
+ (START-PLAYER PLAYER &KEY (SERVER :HUNCHENTOOT))
Start the HTTP server for the given player.
+ The `:server` option will be passed along to Clack.
+
+
+
## Package `GGP-RULES`
Symbol storage package.
--- a/docs/04-changelog.markdown Fri Jul 22 16:22:01 2016 +0000
+++ b/docs/04-changelog.markdown Wed Sep 14 15:22:18 2016 +0000
@@ -5,6 +5,11 @@
[TOC]
+Pending
+-------
+
+* `start-player` now takes a `:server` option which it passed along to Clack.
+
v0.0.1
------
--- a/src/ggp.lisp Fri Jul 22 16:22:01 2016 +0000
+++ b/src/ggp.lisp Wed Sep 14 15:22:18 2016 +0000
@@ -272,11 +272,16 @@
;;;; Spinup/spindown
-(defun start-player (player)
- "Start the HTTP server for the given player."
+(defun start-player (player &key (server :hunchentoot))
+ "Start the HTTP server for the given player.
+
+ The `:server` option will be passed along to Clack.
+
+ "
(let* ((player-handler #'(lambda (env) (app player env)))
(server (clack:clackup player-handler
- :port (player-port player))))
+ :port (player-port player)
+ :server server)))
(setf (slot-value player 'server) server)
player))
@@ -290,5 +295,4 @@
(clack.handler:stop (slot-value player 'server))
(setf (slot-value player 'current-match) nil)
(setf (slot-value player 'match-roles) nil)
- (clear-rules-package)
- )
+ (clear-rules-package))