Class: VectorMCP::Transport::HttpStream::SessionManager::Session Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/vector_mcp/transport/http_stream/session_manager.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

HTTP stream session data structure extending base session

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



23
24
25
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 23

def context
  @context
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



23
24
25
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 23

def created_at
  @created_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



23
24
25
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 23

def id
  @id
end

#last_accessed_atObject

Returns the value of attribute last_accessed_at

Returns:

  • (Object)

    the current value of last_accessed_at



23
24
25
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 23

def last_accessed_at
  @last_accessed_at
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



23
24
25
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 23

def 
  @metadata
end

Instance Method Details

#ageObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 32

def age
  Time.now - created_at
end

#expired?(timeout) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


28
29
30
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 28

def expired?(timeout)
  Time.now - last_accessed_at > timeout
end

#streaming?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


36
37
38
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 36

def streaming?
  [:streaming_connection] && ![:streaming_connection].nil?
end

#streaming_connectionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



40
41
42
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 40

def streaming_connection
  [:streaming_connection]
end

#streaming_connection=(connection) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



44
45
46
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 44

def streaming_connection=(connection)
  [:streaming_connection] = connection
end

#touch!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/vector_mcp/transport/http_stream/session_manager.rb', line 24

def touch!
  self.last_accessed_at = Time.now
end