'Get status of cancellation of my subscription in Combine iOS
I have this simple subscription where my subject is eminting strings. Just for curiosity I would like to know if my subscription is cancelled.
Afaik a pipeline that has been cancelled will not send any completions. Are there some ways do achieve this?
The use case would be that I can cancel all subscriptions and receive a completion on this. Where I can clean up stuff a reflect this probably.
PlaygroundPage.current.needsIndefiniteExecution = true
var disposeBag: Set<AnyCancellable> = .init()
let subject = PassthroughSubject<String, Never>()
subject.sink(receiveCompletion: { completion in
switch completion {
case .failure(let error):
print("Failed with: \(error.localizedDescription)")
case .finished:
print("Finished")
}
}) { string in
print(string)
}.store(in: &disposeBag)
subject.send("A")
disposeBag.map { $0.cancel() }
subject.send("B")
Solution 1:[1]
The ALB does support websockets. But you can't configure the setup like this. One thing you can do is switch over to NLB, but this would require some reconfiguring of the security groups, Listeners, target groups, etc. Why don't you want to use WebRTC?
UPDATE
Come to think of it, Amazon ALB Listeners offers HTTP and HTTPS and WebSockets initially contact the app with HTTP (ws) or HTTPS (wss)
So the ALB shouldn't care about the stream switch/upgrade. The only thing is that the websocket is designed to stay open, and the ALB kills a connection after x seconds (60s i think). But Jitsi doesn't go Idle, so maybe this isn't a problem. I'll try it out and get back to you :)
UPDATE It took a while, but it works. You need to set a couple of things:
JVB_TCP_HARVESTER_DISABLED=true
JVB_TCP_PORT=4443
JVB_TCP_MAPPED_PORT=4443
Set the following back to the default values (leave blank)
ENABLE_SCTP
ENABLE_COLIBRI_WEBSOCKET
ENABLE_XMPP_WEBSOCKET
Make sure you set the PUBLIC_URL variable for all containers (except Prosody) This should be it. Got it working here.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
