! Copyright (C) 2009 Sam Anklesaria. ! See http://factorcode.org/license.txt for BSD license. USING: accessors assocs combinators continuations effects io.encodings.binary io.servers.connection kernel namespaces sequences serialize sets threads vocabs vocabs.parser init io ; IN: modules.rpc-server > serving-vocabs get-global index [ [ args>> ] [ wordname>> ] [ vocabspec>> vocab-words ] tri at [ execute ] curry with-datastack ] [ vocabspec>> \ no-vocab boa ] if serialize flush ; PRIVATE> SYNTAX: service current-vocab name>> serving-vocabs get-global adjoin ; : start-rpc-server ( -- ) binary "rpcs" >>name 9012 >>insecure [ deserialize { { "getter" [ getter ] } { "doer" [ doer ] } { "loader" [ deserialize vocab serialize flush ] } } case ] >>handler start-server ;