rsocket-java icon indicating copy to clipboard operation
rsocket-java copied to clipboard

Support for handling of extension frame

Open robertroeser opened this issue 6 years ago • 5 comments

RSocket spec supports Extension frames: https://github.com/rsocket/rsocket/blob/master/Protocol.md#frame-ext

Add a way to handle extension frames

robertroeser avatar Feb 08 '19 22:02 robertroeser

This or #582.

nebhale avatar Feb 14 '19 23:02 nebhale

@robertroeser if possible to have draft design for frame extension. for example, an interface for Frame handler(ServiceLoader) and payload handler functional interface specification.

public interface RSocketFrameExtensionHandler {
    int frameType();

    int streamIdType();

    FrameFlyweight frameFlyWeight();
    
    PayloadDecoder payloadDecoder();
    //functional interface class
    Class<?> handler();
}
public class RSocketHandlerImpl extends AbstractRSocket implements FrameExtRSocket {

    @Override
    public Mono<Payload> savePointAck(Payload payload) {
        return Mono.empty();
    }
}

linux-china avatar Dec 17 '19 09:12 linux-china

@linux-china I will take a look at what could be done

OlegDokuka avatar Dec 17 '19 13:12 OlegDokuka

One handy pattern from the Scrooge Thrift compiler, when it doesn't understand elements in a thrift frame, it still allows pass through. So for example a thrift struct gets a new field added, or a new enum value is added which is unknown to the server based on it's deployed thrift IDL. It is still allowed to introspect that element even just pass through when the server is a proxy for example.

Not sure we want that, or it implies a "must understand" discussion.

e.g. https://twitter.github.io/scrooge/GeneratedCodeUsage.html

yschimke avatar Dec 19 '19 10:12 yschimke

I guess it would work only in case of proxying on the level of the state machine (frame handler which interprets all the frames)

OlegDokuka avatar Dec 19 '19 11:12 OlegDokuka