| 1 | package SignalWire::Utils; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Exporter qw(import); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use SignalWire::Core::LoggingConfig (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | our @EXPORT_OK = qw(is_serverless_mode); | |||||||||
| 9 | |||||||||||
| 10 | # Cross-language SDK contract: SignalWire::Utils::is_serverless_mode | ||||||||||
| 11 | # mirrors signalwire.utils.is_serverless_mode in the Python reference. | ||||||||||
| 12 | # Returns 1 (true) when running inside any short-lived / event-driven | ||||||||||
| 13 | # environment (i.e. anything other than 'server'); 0 otherwise. | ||||||||||
| 14 | 4 | ▶ | sub is_serverless_mode { | ||||||||
|
Subroutine
is_serverless_mode: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 15 | 4 | ▶ | return SignalWire::Core::LoggingConfig::get_execution_mode() ne 'server' | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | ? 1 | ||||||||||
| 17 | : 0; | ||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 1 | 1; | |||||||||