Skip to content

Conversation

@jonathanstowe
Copy link
Member

Very simplest implementation of a server with fan-out pattern

method listen() {
supply {
whenever self.socket-provider.listen($!host, $!port) -> $conn {
my $connection = Connection.new(:$conn);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether the Connection should have a Promise that is kept when the CONNECT has been completed (which lets us do the authentication or whatever as well,) so that it's not emitted before we have a valid connection.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've implemented that simply. I think there needs to be a hook for authentification.

body => .message;
}
};
$!connected.keep: True;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there also needs to be a timeout (set as a property of the server,) whereby the connection is closed if the 'CONNECT' or 'STOMP' isn't received.

@jonathanstowe
Copy link
Member Author

Can't believe this was four years ago. How time flies. Anyhow I've got an idea that may off two birds which imma try make a PoC over the weekend.

@jonathanstowe
Copy link
Member Author

I've rebased with a view to merging at some point, but in the intervening years I've come to the view that it would make more sense to re-implement in terms of Cro as well as looking at the other existing messaging implementations with a similar view to see if some commonality can be found in terms of interface: it strikes me that part of the reason that Java does so well in the messaging space is because of JMS.

Specifically this provides an implementation of the
SUBSCRIBE/UNSUBSCRIBE commands and a Connection object.

This is sufficient to make a Stomp server.
@jonathanstowe
Copy link
Member Author

I'd like to merge this but there appears to be a problem with the tests on Windows if someone has the wherewithal to diagnose that.

@jonathanstowe
Copy link
Member Author

The Windows is fixed. The MacOS failure on the last run could conceivably happen on any platform, the pattern used in the test may be unreliable depending on the number of threads available, system load etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants