blob: 22f610422efabe0b6f4671ccf9e0a7444c07ffe5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
%% This Source Code Form is subject to the terms of the Mozilla Public
%% License, v. 2.0. If a copy of the MPL was not distributed with this
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
%%
%% Copyright (c) 2020-2021 VMware, Inc. or its affiliates. All rights reserved.
%%
-module(rabbit_stream_management_utils).
-export([keep_stream_connections/1,
keep_tracked_stream_connections/1,
is_stream_connection/1]).
-include_lib("rabbit_common/include/rabbit.hrl").
keep_stream_connections(Connections) ->
lists:filter(fun is_stream_connection/1, Connections).
is_stream_connection(Connection) ->
case lists:keyfind(protocol, 1, Connection) of
{protocol, <<"stream">>} ->
true;
_ ->
false
end.
keep_tracked_stream_connections(Connections) ->
lists:filter(fun (#tracked_connection{protocol = <<"stream">>}) ->
true;
(_) ->
false
end,
Connections).
|