Skip to content

combine multiple pull-streams into one share underlying stream, such as one socket-pull stream can support many duplexes.

License

Notifications You must be signed in to change notification settings

zman2013/multiplex-pull

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multiplex-pull

combine multiple pull-streams into one share underlying stream, such as one socket-pull stream can support many duplexes.

dependency

<dependency>
    <groupId>com.zmannotes</groupId>
    <artifactId>multiplex-pull</artifactId>
    <version>2.1.3</version>
</dependency>

example

IDuplex<byte[]> duplex = new DefaultDuplex<>();

IMultiplex ma = new DefaultMultiplex()
        .onAccept(channel -> {
            link(channel.duplex(), duplex);
        });

IMultiplex mb = new DefaultMultiplex();

link(ma.duplex(), mb.duplex());

// you can create many channels based on one multiplex
IChannel channelB = mb.createChannel("food-model");
ISource<byte[]> source = new DefaultSource<>();
pull(source, channelB.duplex());

About

combine multiple pull-streams into one share underlying stream, such as one socket-pull stream can support many duplexes.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages