zensols.py4j.gateway

Controller application to help with invoking Clojure funcrtions from python. This uses the py4j Java Gateway server library unmarshall requests. This namespace then services the request via the zensols.py4j.invoke-namespace library.

default-port

The default gateway port from the API.

Currently, this is 25333.

gateway

(gateway & {:keys [port entry-point], :or {port default-port, entry-point (invokable-namespace)}})

Create and start a py4j.GatewayServer.

If it’s already been created and started, then return that instance.

gateway-command

CLI command to start the py4j Java side gateway

gateway-port-set-option

(gateway-port-set-option)(gateway-port-set-option short long)(gateway-port-set-option short long port)

invokable-namespace

(invokable-namespace)(invokable-namespace namespace)

Create a default invokable namespace.

restart

(restart)

Restart the gateway server.

shutdown

(shutdown & {:keys [timeout exit?], :or {timeout :now, exit? false}})

Shutdown the gateway server. If key :timeout is provided it will shutdown the gateway immediately if :now, otherwise it expects an integer in milliseconds in the future to shut it down.