nedap / components.pedestal Goto Github PK
View Code? Open in Web Editor NEWPedestal server as a Clojure Component
License: Eclipse Public License 2.0
Pedestal server as a Clojure Component
License: Eclipse Public License 2.0
Add test helpers for
as seen in forester. see this discussion: https://github.com/nedap/pep-forester/pull/92/files/97c4ad089c43b6e5940b7e099f6a0773f8e232c4#diff-8513bcbbd30ba289dcf81038f2ff27e7
introduced different behaviour for new
(satisfies? com.stuartsierra.component/Lifecycle
(nedap.components.pedestal.server.component/new))
=> true
(satisfies? com.stuartsierra.component/Lifecycle
(nedap.components.pedestal.server.component/new))
Execution error (NullPointerException) at nedap.components.pedestal.server.component/new (component.clj:50).
null
(require '[nedap.components.pedestal.server.component])
(nedap.components.pedestal.server.component/new)
554208b
[& {:as opts}]
binds nil
to opts
if no params are provided.
Notice that :or
only binds a value to the variable name (hence the need for :keys
). it does not assoc the key/value in the map itself.
happened while upgrading components.pedestal in nedap/pep-forester.
As made evident by #5 (should-start-or-stop?
is cumbersome / hard to spec), c.p's notion of an :env tends to be complex.
Apps almost never will map 1:1 with c.p's 3 envs (:dev, :test, :production). there's also :staging, :integration-tests, etc
Research if Pedestal's concept of an :env can be ditched; a better approach could be to fully embrace the concept of :defaults-kind (already introduced).
TBA as the proposal is researched.
Moved from: https://github.com/nedap/modular-playground/issues/10
In Mask, we want to be able to set a webserver port, depending on the environment.
For now, since I'm only having to deal with one environment, I can set it statically, like this:
::service/component (-> (service.component/new {::service/pedestal-options {:env environment
:io.pedestal.http/port 4000}
But eventually we'll need to be able to support multiple, e.g. staging 4000
, production 4100
, etc. From what we do at Link, I prefer them myself to be (just) part of the config, in the same sense as hostname
is configured (https://github.com/nedap/modular-playground/blob/master/resources/config.edn#L2), but right now there is no support in c-p to deal with this case.
The option ::pedestal.http/join?
tells the web server to block (true
) or not (false
) after starting.
If the webserver blocks, any system using the server
component do not finish the start up, which may mess with any shutdown handler that would use the started system.
Even if we can change this option to false
in production for all the applications we have, it is quite difficult to detect the shutdown problem if everything seems to work properly after starting the web server.
Set default to false
the option ::pedestal.http/join?
in the service component.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.