(monitor: Monitor, topologyVersion: TopologyVersion | null)
| 243 | } |
| 244 | |
| 245 | function useStreamingProtocol(monitor: Monitor, topologyVersion: TopologyVersion | null): boolean { |
| 246 | // If we have no topology version we always poll no matter |
| 247 | // what the user provided, since the server does not support |
| 248 | // the streaming protocol. |
| 249 | if (topologyVersion == null) return false; |
| 250 | |
| 251 | const serverMonitoringMode = monitor.options.serverMonitoringMode; |
| 252 | if (serverMonitoringMode === ServerMonitoringMode.poll) return false; |
| 253 | if (serverMonitoringMode === ServerMonitoringMode.stream) return true; |
| 254 | |
| 255 | // If we are in auto mode, we need to figure out if we're in a FaaS |
| 256 | // environment or not and choose the appropriate mode. |
| 257 | if (monitor.isRunningInFaasEnv) return false; |
| 258 | return true; |
| 259 | } |
| 260 | |
| 261 | function checkServer(monitor: Monitor, callback: Callback<Document | null>) { |
| 262 | let start: number; |
no outgoing calls
no test coverage detected