Skip to content

Properly deal with dependencies for optional keys in the graph #5

@scizo

Description

@scizo

An example:

(defnk component-a :- ComponentA
  [component-b :- ComponentB
   {component-c :- (s/maybe ComponentC) nil}]
  (->ComponentA component-b component-c))

I would expect that when a component-c key exists that it would be considered a dependency of component-a and started before start is called on component-a. This is currently not the case.

A work around does exist by building the graph with component/using

(def graph
  {:component-b fnk-that-builds-b
   :component-c fnk-that-builds-c
   :component-a (component/using fnk-that-builds-a {:component-c :component-c})})

It would be nice to not have to use component/using.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions