use initital-quot: in threaded-server tuple declaration
parent
4bd06486fb
commit
6c2e483913
|
@ -11,17 +11,17 @@ combinators.short-circuit ;
|
||||||
IN: io.servers.connection
|
IN: io.servers.connection
|
||||||
|
|
||||||
TUPLE: threaded-server
|
TUPLE: threaded-server
|
||||||
name
|
{ name initial: "server" }
|
||||||
log-level
|
{ log-level initial: DEBUG }
|
||||||
secure insecure
|
secure insecure
|
||||||
secure-config
|
{ secure-config initial-quot: [ <secure-config> ] }
|
||||||
sockets
|
{ sockets initial-quot: [ V{ } clone ] }
|
||||||
max-connections
|
max-connections
|
||||||
semaphore
|
semaphore
|
||||||
timeout
|
{ timeout initial-quot: [ 1 minutes ] }
|
||||||
encoding
|
encoding
|
||||||
handler
|
{ handler initial: [ "No handler quotation" throw ] }
|
||||||
ready ;
|
{ ready initial-quot: [ <flag> ] } ;
|
||||||
|
|
||||||
: local-server ( port -- addrspec ) "localhost" swap <inet> ;
|
: local-server ( port -- addrspec ) "localhost" swap <inet> ;
|
||||||
|
|
||||||
|
@ -29,14 +29,7 @@ ready ;
|
||||||
|
|
||||||
: new-threaded-server ( encoding class -- threaded-server )
|
: new-threaded-server ( encoding class -- threaded-server )
|
||||||
new
|
new
|
||||||
swap >>encoding
|
swap >>encoding ;
|
||||||
"server" >>name
|
|
||||||
DEBUG >>log-level
|
|
||||||
1 minutes >>timeout
|
|
||||||
V{ } clone >>sockets
|
|
||||||
<secure-config> >>secure-config
|
|
||||||
[ "No handler quotation" throw ] >>handler
|
|
||||||
<flag> >>ready ; inline
|
|
||||||
|
|
||||||
: <threaded-server> ( encoding -- threaded-server )
|
: <threaded-server> ( encoding -- threaded-server )
|
||||||
threaded-server new-threaded-server ;
|
threaded-server new-threaded-server ;
|
||||||
|
|
Loading…
Reference in New Issue