libe3py 0.4.0__tar.gz → 0.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libe3py
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Python binding of libe3, the O-RAN E3 interface library
5
5
  Author: Northeastern University
6
6
  License-Expression: Apache-2.0
libe3py-0.4.1/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.4.1
@@ -67,6 +67,14 @@ DAppSession(cfg) # ctor registers all inbound handlers
67
67
  → stop() # tear down; unblocks any poll_events
68
68
  ```
69
69
 
70
+ If the RAN releases the dApp or the connection is lost, `poll_events` returns an
71
+ `E3_EVENT_DISCONNECT` event, the dApp id and the subscriptions are gone, and unless
72
+ `cfg.reconnect_interval_ms` is 0 the session registers again by itself after that many
73
+ milliseconds. It gets a new `dapp_id()` and an `E3_EVENT_SETUP_RESPONSE`; subscribe again
74
+ from there. `release()` and `stop()` end it for good. A RAN also releases a dApp that has
75
+ sent nothing for `dapp_idle_timeout_s` (default 1800), so a dApp that only listens comes
76
+ back about that often.
77
+
70
78
  ## Minimal Python example
71
79
 
72
80
  ```python
@@ -29,23 +29,33 @@ inline std::optional<uint32_t> opt_u32(int v) {
29
29
  }
30
30
  } // namespace
31
31
 
32
+ /// What a DAppSession holds: the agent, the event queue and the setup snapshot.
32
33
  struct DAppSession::Impl {
34
+ /**
35
+ * @brief Create the agent and the event queue
36
+ * @param config The agent's configuration
37
+ * @param queue_capacity Number of events the queue holds
38
+ */
33
39
  explicit Impl(libe3::E3Config config, std::size_t queue_capacity)
34
40
  : agent(std::make_unique<libe3::E3Agent>(std::move(config))),
35
41
  queue(queue_capacity) {}
36
42
 
37
- std::unique_ptr<libe3::E3Agent> agent;
43
+ std::unique_ptr<libe3::E3Agent> agent; ///< The dApp agent
38
44
  // Stable object (never moved) so a poll_events() reference stays valid; a
39
45
  // prior stop() shut it down, and start() re-arms it in place (LockFreeQueue's
40
46
  // shutdown is one-way, E3Agent itself is restartable).
41
- libe3::LockFreeQueue<E3Event> queue;
42
- std::atomic<unsigned long long> dropped{0};
47
+ libe3::LockFreeQueue<E3Event> queue; ///< Events waiting for poll_events()
48
+ std::atomic<unsigned long long> dropped{0}; ///< Events dropped because the queue was full
43
49
 
44
50
  // SetupResponse snapshot for the setup accessors (written once on setup).
45
- mutable std::mutex setup_mu;
46
- bool have_setup{false};
47
- libe3::SetupResponse setup;
48
-
51
+ mutable std::mutex setup_mu; ///< Guards have_setup and setup
52
+ bool have_setup{false}; ///< Whether a setup response has been seen
53
+ libe3::SetupResponse setup; ///< The latest setup response
54
+
55
+ /**
56
+ * @brief Queue an event for poll_events()
57
+ * @param ev The event; it is dropped, and counted, if the queue is full
58
+ */
49
59
  void enqueue(E3Event ev) {
50
60
  const uint64_t seq = latrec_seq_next();
51
61
  ev.trace_seq = seq;
@@ -139,6 +149,7 @@ DAppSession::DAppSession(libe3::E3Config config, std::size_t queue_capacity) {
139
149
  });
140
150
  }
141
151
 
152
+ /// Stops the agent and drops the queue.
142
153
  DAppSession::~DAppSession() {
143
154
  if (impl_) {
144
155
  impl_->queue.shutdown();
libe3py-0.4.0/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.4.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes