pg_proxy.cpp 750 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "pg_proxy.h"
  2. #include "pg_connection.h"
  3. #include "pg_listener.h"
  4. #include <ydb/library/actors/core/actor_bootstrapped.h>
  5. #include <ydb/library/actors/interconnect/poller_actor.h>
  6. namespace NPG {
  7. using namespace NActors;
  8. using namespace NKikimr::NRawSocket;
  9. class TPGProxy : public TActorBootstrapped<TPGProxy> {
  10. public:
  11. TPGProxy()
  12. {
  13. }
  14. void Bootstrap() {
  15. Poller = Register(CreatePollerActor());
  16. Listener = Register(CreatePGListener(Poller, {}));
  17. Become(&TPGProxy::StateWork);
  18. }
  19. STATEFN(StateWork) {
  20. switch (ev->GetTypeRewrite()) {
  21. }
  22. }
  23. TActorId Poller;
  24. TActorId Listener;
  25. };
  26. NActors::IActor* CreatePGProxy() {
  27. return new TPGProxy();
  28. }
  29. } // namespace NPG