flush()
Signature
Flushes all pending spans through the processor pipeline to exporters. Available on both Respan and RespanClient.
Example
Use flush() before process exit or in serverless/Lambda environments to ensure all spans are exported. In long-running applications with batch processing enabled, spans are flushed automatically at regular intervals.