This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.apple.acs.traffic.servicediscovery.insights.aggregator; | |
import io.servicetalk.concurrent.PublisherSource; | |
import io.servicetalk.concurrent.PublisherSource.Processor; | |
import io.servicetalk.concurrent.api.Publisher; | |
import io.servicetalk.concurrent.internal.TerminalNotification; | |
import javax.annotation.Nullable; | |
import java.util.concurrent.CountDownLatch; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright © 2018 Apple Inc. and the ServiceTalk project authors | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright © 2019 Apple Inc. and the ServiceTalk project authors | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.InetSocketAddress; | |
import java.net.SocketAddress; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicLong; | |
import io.reactivesocket.ReactiveSocket; | |
import io.reactivesocket.client.KeepAliveProvider; | |
import io.reactivesocket.client.ReactiveSocketClient; | |
import io.reactivesocket.client.SetupProvider; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.reactivex.netty.examples.http; | |
import io.netty.buffer.ByteBuf; | |
import io.netty.channel.ChannelDuplexHandler; | |
import io.netty.channel.ChannelHandlerContext; | |
import io.netty.channel.ChannelPromise; | |
import io.netty.handler.codec.http.HttpRequest; | |
import io.reactivex.netty.RxNetty; | |
import io.reactivex.netty.protocol.http.AbstractHttpContentHolder; | |
import io.reactivex.netty.protocol.http.client.HttpClient; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rx.Observable; | |
public class Pager { | |
public static void main(String[] args) { | |
Observable.range(1, 1000) | |
.window(10) | |
.doOnNext(nextBatch -> System.out.println("Next page.")) | |
.flatMap(nums -> nums, 1) | |
.forEach(System.out::println); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2015 Netflix, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable<WebSocketConnection> source = HttpClient.newClient() | |
.createGet("/ws") | |
.requestWebSocketUpgrade() | |
.doOnNext(resp -> logger.info(resp.toString())) | |
.map(WebSocketResponse::getWebSocketConnection) | |
.nest() | |
.lift(new OperatorCacheSingleWebsocketConnection()); | |
Observable.interval(1, TimeUnit.SECONDS) | |
.map(aTick -> Observable.<WebSocketFrame>just(new MessageFrame(MessageType.Message, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2015 Netflix, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2015 Netflix, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder