@Override
    public void onReceive(final Object data) {
      ActivityComponentContext activityComponentContext = activityComponent.getComponentContext();
      if (!activityComponentContext.canHandlerRun()) {
        return;
      }

      try {
        activityComponentContext.enterHandler();

        delegate.onReceive(data);
      } catch (Throwable e) {
        activityComponent.handleError("Error during web socket data receive", e);
      } finally {
        activityComponentContext.exitHandler();
      }
    }
    @Override
    public void onConnect() {
      ActivityComponentContext activityComponentContext = activityComponent.getComponentContext();
      if (!activityComponentContext.canHandlerRun()) {
        return;
      }

      try {
        activityComponentContext.enterHandler();

        delegate.onConnect();
      } catch (Throwable e) {
        activityComponent.handleError("Error during web socket connection", e);
      } finally {
        connected.set(true);

        activityComponentContext.exitHandler();
      }
    }