Skip to content

Commit

Permalink
Merge branch 'main' into tls-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
berndverst authored Nov 1, 2023
2 parents 6caf1f9 + 040045c commit 38bdbc0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ext/dapr-ext-grpc/dapr/ext/grpc/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,19 @@ def add_external_service(self, servicer_callback, external_servicer):
"""Adds an external gRPC service to the same server"""
servicer_callback(external_servicer, self._server)

def run(self, app_port: Optional[int] = None) -> None:
"""Starts app gRPC server and waits until :class:`App`.stop() is called."""
def run(self, app_port: Optional[int] = None, listen_address: Optional[str] = None) -> None:
"""Starts app gRPC server and waits until :class:`App`.stop() is called.
Args:
app_port (int, optional): The port on which to listen for incoming gRPC calls.
Defaults to settings.GRPC_APP_PORT.
listen_address (str, optional): The IP address on which to listen for incoming gRPC
calls. Defaults to [::] (all IP addresses).
"""
if app_port is None:
app_port = settings.GRPC_APP_PORT
self._server.add_insecure_port(f'[::]:{app_port}')
self._server.add_insecure_port(
f'{listen_address if listen_address else "[::]"}:{app_port}')
self._server.start()
self._server.wait_for_termination()

Expand Down

0 comments on commit 38bdbc0

Please sign in to comment.