Skip to content

Commit

Permalink
feat(app): add IsRunning function
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcorado committed Jan 18, 2021
1 parent e2e622c commit 9e393b0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ type Pitaya interface {
StartWorker()
RegisterRPCJob(rpcJob worker.RPCJob) error
Documentation(getPtrNames bool) (map[string]interface{}, error)
IsRunning() bool

RPC(ctx context.Context, routeStr string, reply proto.Message, arg proto.Message) error
RPCTo(ctx context.Context, serverID, routeStr string, reply proto.Message, arg proto.Message) error
Expand Down Expand Up @@ -252,6 +253,13 @@ func (app *App) GetServers() []*cluster.Server {
return app.serviceDiscovery.GetServers()
}

// IsRunning indicates if the Pitaya app has been initialized. Note: This
// doesn't cover acceptors, only the pitaya internal registration and modules
// initialization.
func (app *App) IsRunning() bool {
return app.running
}

// SetLogger logger setter
func SetLogger(l logging.Logger) {
logger.Log = l
Expand Down
14 changes: 14 additions & 0 deletions mocks/app.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9e393b0

Please sign in to comment.