MCPcopy Create free account
hub / github.com/codnect/procyon / putToPreparation

Method putToPreparation

component/state.go:66–76  ·  view source on GitHub ↗

putToPreparation adds the given name to the in-creation map. Returns an error if it's already there (to prevent circular creation).

(name string)

Source from the content-addressed store, hash-verified

64// putToPreparation adds the given name to the in-creation map.
65// Returns an error if it's already there (to prevent circular creation).
66func (s *creationState) putToPreparation(name string) error {
67 s.mu.Lock()
68 defer s.mu.Unlock()
69
70 if _, ok := s.currentlyInCreation[name]; ok {
71 return ErrInstanceInPreparation
72 }
73
74 s.currentlyInCreation[name] = struct{}{}
75 return nil
76}
77
78// removeFromPreparation removes the given name from the in-creation map.
79func (s *creationState) removeFromPreparation(name string) {

Callers 3

ResolveMethod · 0.80
createSingletonMethod · 0.80

Calls

no outgoing calls

Tested by 1