Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindings optimization to support binary -> binary + some refactoring #270

Merged
merged 5 commits into from
Jan 14, 2020

Conversation

slinkydeveloper
Copy link
Member

@slinkydeveloper slinkydeveloper commented Dec 5, 2019

Fixes #262
Depends on #274

Overview

Starting from @alanconway work (#263) I've reorganized a bit the Message interface to allow both binary -> binary message passing and structured -> structured.

The Encoder pattern allows to the receiver message to extract informations and to the sender to encode these informations in the right request structure.

I modified both HTTP and AMQP binding implementations to support new interfaces.

Benchmark

From https://github.com/cloudevents/sdk-go/tree/master/test/benchmark/http

8Kb payload (left is #274, right is this patch)
8k

16Kb payload (left is #274, right is this patch)
16k

32Kb payload (left is #274, right is this patch)
32k

@slinkydeveloper
Copy link
Member Author

HTTP binding now working (with tests too), AMQP still WIP

@slinkydeveloper
Copy link
Member Author

AMQP implemented, still some stuff broken because of encoding

@slinkydeveloper slinkydeveloper force-pushed the bindings-optimize branch 2 times, most recently from a4fc562 to 8acac5c Compare December 19, 2019 11:38
@slinkydeveloper slinkydeveloper marked this pull request as ready for review December 19, 2019 11:39
@slinkydeveloper
Copy link
Member Author

cc @n3wscott @alanconway

@n3wscott
Copy link
Member

n3wscott commented Jan 6, 2020

OH MY! this is going to be grand, thanks for looking at this.

alanconway and others added 5 commits January 7, 2020 08:51
Non-functioning code! This is an API proposal for cloudevents#262

NOTE: the proposal is incompatible with current API (adds a method to Message)

If it needs to be made compatible, the Binary() method can be moved to a new
interface (e.g. BinaryMessage) and the user can cast.

Signed-off-by: Alan Conway <aconway@redhat.com>
Added Transcoders, to transcode message between sender and receiver
Reimplemented http & amqp binding with new interfaces

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Added translate function, to abstract message reading process

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@slinkydeveloper
Copy link
Member Author

Rebased with master, now it's ready to review 😄

@slinkydeveloper slinkydeveloper changed the title WIP Bindings optimization to support binary -> binary + some refactoring Bindings optimization to support binary -> binary + some refactoring Jan 7, 2020
@n3wscott
Copy link
Member

LGTM

@n3wscott n3wscott merged commit 0a4be0a into cloudevents:master Jan 14, 2020
@slinkydeveloper slinkydeveloper deleted the bindings-optimize branch January 14, 2020 15:28
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.

binding to transfer binary events without allocating an intermediate
3 participants