| @@ -351,7 +351,7 @@ fn grant :: |
| 351 | 351 | process.send reply Ok(info.conn) |
| 352 | 352 | PoolState( ..state |
| 353 | 353 | , checked_out: [(borrower, info), ..state.checked_out] |
| 354 | | − , monitored: watch info.conn.owner (watch borrower state.monitored) |
| 354 | + , monitored: watch (process.owner info.conn) (watch borrower state.monitored) |
| 355 | 355 | ) |
| 356 | 356 | } |
| 357 | 357 | |
| @@ -378,7 +378,9 @@ fn returned :: |
| 378 | 378 | { |
| 379 | 379 | actor.cast conn client.Close(process.subject ()) |
| 380 | 380 | drain |
| 381 | | − PoolState(..state, monitored: unwatch Some(conn.owner) state.monitored) |
| 381 | + PoolState( ..state |
| 382 | + , monitored: unwatch Some(process.owner conn) state.monitored |
| 383 | + ) |
| 382 | 384 | } |
| 383 | 385 | , _ -> match state.waiting |
| 384 | 386 | { [(borrower, reply), ..rest] -> match info |
| @@ -416,7 +418,7 @@ fn ponged :: |
| 416 | 418 | , Error(_) -> |
| 417 | 419 | grant_or_queue |
| 418 | 420 | PoolState( ..state |
| 419 | | − , monitored: unwatch Some(conn.owner) state.monitored |
| 421 | + , monitored: unwatch Some(process.owner conn) state.monitored |
| 420 | 422 | ) |
| 421 | 423 | borrower |
| 422 | 424 | reply |
| @@ -429,7 +431,9 @@ fn ponged :: |
| 429 | 431 | else |
| 430 | 432 | { |
| 431 | 433 | actor.cast conn client.Close(process.subject ()) |
| 432 | | − PoolState(..state, monitored: unwatch Some(conn.owner) state.monitored) |
| 434 | + PoolState( ..state |
| 435 | + , monitored: unwatch Some(process.owner conn) state.monitored |
| 436 | + ) |
| 433 | 437 | } |
| 434 | 438 | } |
| 435 | 439 | } |
| @@ -606,7 +610,7 @@ fn expire_checks :: state: PoolState -> PoolState / <io, proc, random> |
| 606 | 610 | actor.cast info.conn client.Close(process.subject ()) |
| 607 | 611 | let state = |
| 608 | 612 | PoolState( ..state |
| 609 | | − , monitored: unwatch Some(info.conn.owner) state.monitored |
| 613 | + , monitored: unwatch Some(process.owner info.conn) state.monitored |
| 610 | 614 | ) |
| 611 | 615 | expire_checks (grant_or_queue state borrower reply) |
| 612 | 616 | } |
| @@ -654,7 +658,7 @@ fn reap :: state: PoolState -> PoolState / <proc> |
| 654 | 658 | fn m entry |
| 655 | 659 | { |
| 656 | 660 | let (info, _) = entry |
| 657 | | − unwatch Some(info.conn.owner) m |
| 661 | + unwatch Some(process.owner info.conn) m |
| 658 | 662 | } |
| 659 | 663 | ) |
| 660 | 664 | } |
| @@ -752,7 +756,9 @@ fn owner_of :: |
| 752 | 756 | { |
| 753 | 757 | match entries |
| 754 | 758 | { [] -> None |
| 755 | | − , [(pid, info), ..rest] -> if info.conn.owner == conn.owner |
| 759 | + , [ (pid, info) |
| 760 | + , ..rest |
| 761 | + ] -> if process.owner info.conn == process.owner conn |
| 756 | 762 | { |
| 757 | 763 | Some(pid) |
| 758 | 764 | } |
| @@ -771,7 +777,9 @@ fn info_of :: |
| 771 | 777 | { |
| 772 | 778 | match entries |
| 773 | 779 | { [] -> None |
| 774 | | − , [(_, info), ..rest] -> if info.conn.owner == conn.owner |
| 780 | + , [ (_, info) |
| 781 | + , ..rest |
| 782 | + ] -> if process.owner info.conn == process.owner conn |
| 775 | 783 | { |
| 776 | 784 | Some(info) |
| 777 | 785 | } |
| @@ -792,7 +800,7 @@ fn drop_conn :: |
| 792 | 800 | { [] -> [] |
| 793 | 801 | , [ (p, info) |
| 794 | 802 | , ..rest |
| 795 | | − ] -> if info.conn.owner == conn.owner |
| 803 | + ] -> if process.owner info.conn == process.owner conn |
| 796 | 804 | { |
| 797 | 805 | drop_conn rest conn |
| 798 | 806 | } |
| @@ -811,7 +819,9 @@ fn find_checking :: |
| 811 | 819 | { |
| 812 | 820 | match entries |
| 813 | 821 | { [] -> None |
| 814 | | − , [entry, ..rest] -> if entry.info.conn.owner == conn.owner |
| 822 | + , [ entry |
| 823 | + , ..rest |
| 824 | + ] -> if process.owner entry.info.conn == process.owner conn |
| 815 | 825 | { |
| 816 | 826 | Some(entry) |
| 817 | 827 | } |
| @@ -849,7 +859,7 @@ fn find_checking_by_owner :: |
| 849 | 859 | { |
| 850 | 860 | match entries |
| 851 | 861 | { [] -> None |
| 852 | | − , [entry, ..rest] -> if entry.info.conn.owner == pid |
| 862 | + , [entry, ..rest] -> if process.owner entry.info.conn == pid |
| 853 | 863 | { |
| 854 | 864 | Some(entry) |
| 855 | 865 | } |
| @@ -870,7 +880,7 @@ fn drop_checking :: |
| 870 | 880 | { [] -> [] |
| 871 | 881 | , [ entry |
| 872 | 882 | , ..rest |
| 873 | | − ] -> if entry.info.conn.owner == conn.owner |
| 883 | + ] -> if process.owner entry.info.conn == process.owner conn |
| 874 | 884 | { |
| 875 | 885 | drop_checking rest conn |
| 876 | 886 | } |
| @@ -886,7 +896,8 @@ fn is_idle :: entries: List<(ConnInfo, Int)> conn: Subject<client.Msg> -> Bool |
| 886 | 896 | { |
| 887 | 897 | match entries |
| 888 | 898 | { [] -> False |
| 889 | | − , [(info, _), ..rest] -> info.conn.owner == conn.owner || is_idle rest conn |
| 899 | + , [(info, _), ..rest] -> |
| 900 | + process.owner info.conn == process.owner conn || is_idle rest conn |
| 890 | 901 | } |
| 891 | 902 | } |
| 892 | 903 | |
| @@ -898,7 +909,7 @@ fn find_owner :: |
| 898 | 909 | { |
| 899 | 910 | match list_ |
| 900 | 911 | { [] -> None |
| 901 | | − , [entry, ..rest] -> if entry.0.conn.owner == pid |
| 912 | + , [entry, ..rest] -> if process.owner entry.0.conn == pid |
| 902 | 913 | { |
| 903 | 914 | Some(entry) |
| 904 | 915 | } |
| @@ -915,7 +926,7 @@ fn drop_owner :: list_: List<(ConnInfo, Int)> pid: Pid -> List<(ConnInfo, Int)> |
| 915 | 926 | { [] -> [] |
| 916 | 927 | , [ entry |
| 917 | 928 | , ..rest |
| 918 | | − ] -> if entry.0.conn.owner == pid |
| 929 | + ] -> if process.owner entry.0.conn == pid |
| 919 | 930 | { |
| 920 | 931 | drop_owner rest pid |
| 921 | 932 | } |
| @@ -987,5 +998,7 @@ fn monitor_all :: |
| 987 | 998 | -> List<(Pid, Subject<Down>)> / <proc> |
| 988 | 999 | { |
| 989 | 1000 | match conns |
| 990 | | − { [] -> acc, [conn, ..rest] -> monitor_all rest (watch conn.owner acc) } |
| 1001 | + { [] -> acc |
| 1002 | + , [conn, ..rest] -> monitor_all rest (watch (process.owner conn) acc) |
| 1003 | + } |
| 991 | 1004 | } |