---
title: llarp/layers/flow/flow_establish.hpp

---

# llarp/layers/flow/flow_establish.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::layers](Namespaces/namespacellarp_1_1layers.md)**  |
| **[llarp::layers::flow](Namespaces/namespacellarp_1_1layers_1_1flow.md)**  |

## Classes

|                | Name           |
| -------------- | -------------- |
| class | **[llarp::layers::flow::FlowEstablish](Classes/classllarp_1_1layers_1_1flow_1_1FlowEstablish.md)** <br>handles informing an observer at each step of obtaining a flow on the flow layer.  |




## Source code

```cpp
#pragma once

#include <functional>
#include <string>
#include <optional>

#include "flow_info.hpp"
#include "flow_auth.hpp"

namespace llarp::layers::flow
{

  class FlowEstablish
  {
    std::function<void(std::optional<FlowInfo>, std::string)> _completion_handler;
    std::function<void(FlowAuthPhase, std::string)> _phase_handler;
    std::optional<FlowInfo> _result;

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

    std::string authcode;

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

    void
    enter_phase(FlowAuthPhase phase, std::string info);

    void
    fail(std::string msg);

    void
    ready(FlowInfo flow_info);
  };
}  // namespace llarp::layers::flow
```


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

Updated on 2023-03-06 at 20:36:34 +0000
