You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: container_exec.rb
    path of file: ./repos/kontena/agent/lib/kontena/actors
    
    the code of the file until where you have to start completion: require_relative '../helpers/rpc_helper'

module Kontena::Actors
  class ContainerExec
    include Celluloid
    include Kontena::Logging
    include Kontena::Helpers::RpcHelper

    exclusive :input

    attr_reader :uuid

    # @param [Docker::Container] container
    def initialize(container)
      @uuid = SecureRandom.uuid
      @container = container
      @read_pipe, @write_pipe = IO.pipe
      info "initialized (session #{@uuid})"
    end

    # @para
    
    def tty_resize(size)
      return unless @container_exec

      begin
        @container_exec.resize({
          'w' => size['width'], 'h' => size['height']
        })
        info "tty resized to #{size['width']}x#{size['height']}"
      rescue Docker::Error::DockerError => exc
        # The Docker::Exec#resize races with the Docker::Exec#start, and the
        # resize (POST /exec/.../resize) will fail if the exec process is not
        # yet running:
        #   Docker::Error::NotFoundError: containerd: process not found for container
        if exc.message.include?('process not found')
          # This needs to wait for the start => POST /exec/.../start HTTP request
          # to return the response headers, but the Docker::Exec#start API does
          # not tell us when that happens (it only yields on the first streaming
          # chunk, or returns when the exec exits)... just retry instead.
          sleep 0.1
          retry if @container_exec
        end
      end