Skip to content

Commit

Permalink
feat: disable mux (#40)
Browse files Browse the repository at this point in the history
Add the option to entirely disable the mux server for applications that
don't need any network server at all.
  • Loading branch information
jgkawell authored Aug 23, 2024
1 parent 11e0e3c commit ffe826a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/chassis/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ func (c *Runtime) WithRoute(route *ntv1.Route) *Runtime {
return c
}

func (c *Runtime) DisableMux() *Runtime {
c.noMux = true
return c
}

// /////////////////
// System Functions
// /////////////////
Expand Down Expand Up @@ -214,7 +219,9 @@ func (c *Runtime) Start() {
c.runRPC(close, handler)
}

go c.runMux(close, handler)
if !c.noMux {
go c.runMux(close, handler)
}

// TODO: start consumers

Expand Down
1 change: 1 addition & 0 deletions pkg/chassis/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Runtime struct {
repositories []Repository
secretStores []SecretStore
isRPC bool
noMux bool
rpcReflectionServiceNames []string
mux *http.ServeMux
consensusKind ConsensusKind
Expand Down

0 comments on commit ffe826a

Please sign in to comment.