---
title: llarp::layers::flow::FlowEstablish
summary: handles informing an observer at each step of obtaining a flow on the flow layer. 

---

# llarp::layers::flow::FlowEstablish



handles informing an observer at each step of obtaining a flow on the flow layer. 


`#include <flow_establish.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[FlowEstablish](Classes/classllarp_1_1layers_1_1flow_1_1FlowEstablish.md#function-flowestablish)**(std::function< void(std::optional< [FlowInfo](Classes/structllarp_1_1layers_1_1flow_1_1FlowInfo.md) >, std::string)> completion_handler, std::function< void(FlowAuthPhase, std::string)> phase_handler) |
| void | **[enter_phase](Classes/classllarp_1_1layers_1_1flow_1_1FlowEstablish.md#function-enter-phase)**(FlowAuthPhase phase, std::string info)<br>enter phase of flow establishment.  |
| void | **[fail](Classes/classllarp_1_1layers_1_1flow_1_1FlowEstablish.md#function-fail)**(std::string msg)<br>explicitly fail establishment with an error message.  |
| void | **[ready](Classes/classllarp_1_1layers_1_1flow_1_1FlowEstablish.md#function-ready)**([FlowInfo](Classes/structllarp_1_1layers_1_1flow_1_1FlowInfo.md) flow_info)<br>explicitly inform that we are done with the establishment and we are ready to send.  |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| std::string | **[authcode](Classes/classllarp_1_1layers_1_1flow_1_1FlowEstablish.md#variable-authcode)** <br>an optional static auth code  |
| std::chrono::milliseconds | **[timeout](Classes/classllarp_1_1layers_1_1flow_1_1FlowEstablish.md#variable-timeout)** <br>how long we wait for establishment timeout  |

## Public Functions Documentation

### function FlowEstablish

```cpp
FlowEstablish(
    std::function< void(std::optional< FlowInfo >, std::string)> completion_handler,
    std::function< void(FlowAuthPhase, std::string)> phase_handler
)
```


### function enter_phase

```cpp
void enter_phase(
    FlowAuthPhase phase,
    std::string info
)
```

enter phase of flow establishment. 

### function fail

```cpp
void fail(
    std::string msg
)
```

explicitly fail establishment with an error message. 

### function ready

```cpp
void ready(
    FlowInfo flow_info
)
```

explicitly inform that we are done with the establishment and we are ready to send. 

calls _completion_handler. 


## Public Attributes Documentation

### variable authcode

```cpp
std::string authcode;
```

an optional static auth code 

### variable timeout

```cpp
std::chrono::milliseconds timeout {5s};
```

how long we wait for establishment timeout 

-------------------------------

Updated on 2023-04-27 at 04:17:17 +0000