|
| 1 | +/** |
| 2 | + * Copyright 2015 Netflix, Inc. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +package io.reactivesocket.internal; |
| 17 | + |
| 18 | +import org.reactivestreams.Publisher; |
| 19 | +import org.reactivestreams.Subscriber; |
| 20 | +import org.reactivestreams.Subscription; |
| 21 | + |
| 22 | +import io.reactivesocket.Frame; |
| 23 | +import io.reactivesocket.FrameType; |
| 24 | +import io.reactivesocket.Payload; |
| 25 | +import io.reactivesocket.internal.frame.PayloadFragmenter; |
| 26 | + |
| 27 | +public class FragmentedPublisher implements Publisher<Frame> { |
| 28 | + |
| 29 | + private final PayloadFragmenter fragmenter = new PayloadFragmenter(Frame.METADATA_MTU, Frame.DATA_MTU); |
| 30 | + private final Publisher<Payload> responsePublisher; |
| 31 | + private final int streamId; |
| 32 | + private final FrameType type; |
| 33 | + |
| 34 | + public FragmentedPublisher(FrameType type, int streamId, Publisher<Payload> responsePublisher) { |
| 35 | + this.type = type; |
| 36 | + this.streamId = streamId; |
| 37 | + this.responsePublisher = responsePublisher; |
| 38 | + } |
| 39 | + |
| 40 | + @Override |
| 41 | + public void subscribe(Subscriber<? super Frame> child) { |
| 42 | + child.onSubscribe(new Subscription() { |
| 43 | + |
| 44 | + @Override |
| 45 | + public void request(long n) { |
| 46 | + // TODO Auto-generated method stub |
| 47 | + |
| 48 | + } |
| 49 | + |
| 50 | + @Override |
| 51 | + public void cancel() { |
| 52 | + // TODO Auto-generated method stub |
| 53 | + |
| 54 | + }}); |
| 55 | + } |
| 56 | + |
| 57 | +} |
0 commit comments