|
7 | 7 | ./events/json_message_event, |
8 | 8 | ./events/json_topic_health_change_event, |
9 | 9 | ./events/json_connection_change_event, |
| 10 | + ./events/json_connection_status_change_event, |
10 | 11 | ../waku/factory/app_callbacks, |
11 | 12 | waku/factory/waku, |
12 | 13 | waku/node/waku_node, |
| 14 | + waku/node/health_monitor/health_status, |
13 | 15 | ./declare_lib |
14 | 16 |
|
15 | 17 | ################################################################################ |
@@ -61,10 +63,16 @@ proc waku_new( |
61 | 63 | callEventCallback(ctx, "onConnectionChange"): |
62 | 64 | $JsonConnectionChangeEvent.new($peerId, peerEvent) |
63 | 65 |
|
| 66 | + proc onConnectionStatusChange(ctx: ptr FFIContext): ConnectionStatusChangeHandler = |
| 67 | + return proc(status: ConnectionStatus) {.async.} = |
| 68 | + callEventCallback(ctx, "onConnectionStatusChange"): |
| 69 | + $JsonConnectionStatusChangeEvent.new(status) |
| 70 | + |
64 | 71 | let appCallbacks = AppCallbacks( |
65 | 72 | relayHandler: onReceivedMessage(ctx), |
66 | 73 | topicHealthChangeHandler: onTopicHealthChange(ctx), |
67 | 74 | connectionChangeHandler: onConnectionChange(ctx), |
| 75 | + connectionStatusChangeHandler: onConnectionStatusChange(ctx) |
68 | 76 | ) |
69 | 77 |
|
70 | 78 | ffi.sendRequestToFFIThread( |
|
0 commit comments