2017-03-20 18:08:30 +00:00
|
|
|
module DB
|
|
|
|
module ConnectionContext
|
|
|
|
# Indicates that the *connection* was permanently closed
|
|
|
|
# and should not be used in the future.
|
|
|
|
abstract def discard(connection : Connection)
|
|
|
|
|
|
|
|
# Indicates that the *connection* is no longer needed
|
|
|
|
# and can be reused in the future.
|
|
|
|
abstract def release(connection : Connection)
|
|
|
|
end
|
|
|
|
|
|
|
|
# :nodoc:
|
|
|
|
class SingleConnectionContext
|
|
|
|
include ConnectionContext
|
|
|
|
|
2023-06-23 01:03:08 +00:00
|
|
|
class_getter default : SingleConnectionContext = SingleConnectionContext.new
|
2017-03-20 18:08:30 +00:00
|
|
|
|
|
|
|
def discard(connection : Connection)
|
|
|
|
end
|
|
|
|
|
|
|
|
def release(connection : Connection)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|