mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
User defined context store types (#339)
allow the context storage to handle any types
This commit is contained in:
parent
48128696c6
commit
0b4856b741
4 changed files with 43 additions and 2 deletions
|
@ -12,6 +12,23 @@ class CustomLogHandler < Kemal::BaseLogHandler
|
|||
end
|
||||
end
|
||||
|
||||
class TestContextStorageType
|
||||
property id
|
||||
@id = 1
|
||||
|
||||
def to_s
|
||||
@id
|
||||
end
|
||||
end
|
||||
|
||||
class AnotherContextStorageType
|
||||
property name
|
||||
@name = "kemal-context"
|
||||
end
|
||||
|
||||
add_context_storage_type(TestContextStorageType)
|
||||
add_context_storage_type(AnotherContextStorageType)
|
||||
|
||||
def create_request_and_return_io(handler, request)
|
||||
io = IO::Memory.new
|
||||
response = HTTP::Server::Response.new(io)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue