userver icon indicating copy to clipboard operation
userver copied to clipboard

wip on userver amqp

Open itrofimow opened this issue 2 years ago • 1 comments

Addresses https://github.com/userver-framework/userver/issues/44

itrofimow avatar Jul 27 '22 01:07 itrofimow

Just a few nitpicks for now. Will take a deeper look later

This PR is still a work in progress (it's even draft here on github) and it has a lot of places that require more attention from me, so much deeper look is not required/expected yet. I created this PR for 2 reasons mostly:

  1. Show you guys that some work is being done and in what state it is
  2. I would appreciate some hints on reusing socket logic from non-coroutine threads (socket logic itself ain't that hard to copy-paste, TlsWrapper is another story)

There are 2 problems with Socket: Wait call in Direction::PerformIo and this Lock - they both expect to be executed/used from coroutine threads. What i did for now is just some ugly tricks that are not expected to stay just to make my draft work

To summarize:

  1. thoughtful review is not required/expected yet, but suggestions would be appreciated anyway
  2. how do i reuse TslWrapper from non-coroutine threads?

itrofimow avatar Jul 28 '22 11:07 itrofimow

Although there are some feature that are either absent or could be done better i'll call it a day for now. Features i'm talking about are:

  • Headers in Publish/Admin:: methods (absent)
  • Metrics (could be done better)
  • Tests (probably could be done better) - tests for different errors are somewhat lacking, but it's almost impossible to implement them: that would require manual intervention via rabbitmqctl or complete outside control of running RabbitMQ server.
  • Dynamic config (absent)

I might get back to these features at some point, but i'd like to feature-freeze this PR 'cause i'm a bit exhausted with it.

@apolukhin @segoon @nUl1 could you please have a look?

itrofimow avatar Aug 21 '22 12:08 itrofimow

Thank you for the awesome patch!

apolukhin avatar Sep 04 '22 10:09 apolukhin