mudis 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +861 -695
 - data/lib/mudis/version.rb +3 -3
 - data/lib/mudis.rb +521 -521
 - data/lib/mudis_client.rb +65 -68
 - data/lib/mudis_config.rb +25 -25
 - data/lib/mudis_proxy.rb +33 -0
 - data/lib/mudis_server.rb +81 -79
 - data/sig/mudis.rbs +56 -56
 - data/sig/mudis_client.rbs +23 -0
 - data/sig/mudis_config.rbs +10 -10
 - data/sig/mudis_server.rbs +7 -0
 - data/spec/eviction_spec.rb +29 -29
 - data/spec/guardrails_spec.rb +138 -138
 - data/spec/memory_guard_spec.rb +33 -33
 - data/spec/metrics_spec.rb +34 -34
 - data/spec/mudis_client_spec.rb +137 -0
 - data/spec/mudis_server_spec.rb +90 -0
 - data/spec/mudis_spec.rb +183 -183
 - data/spec/namespace_spec.rb +69 -69
 - data/spec/reset_spec.rb +31 -31
 - metadata +16 -4
 - data/lib/example_mudis_server_config.md +0 -39
 
| 
         @@ -1,39 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            ```ruby
         
     | 
| 
       2 
     | 
    
         
            -
            # config/initializers/mudis_proxy.rb
         
     | 
| 
       3 
     | 
    
         
            -
            unless defined?(MudisServer)
         
     | 
| 
       4 
     | 
    
         
            -
              module Mudis
         
     | 
| 
       5 
     | 
    
         
            -
                def self.read(*a, **k) = $mudis.read(*a, **k)
         
     | 
| 
       6 
     | 
    
         
            -
                def self.write(*a, **k) = $mudis.write(*a, **k)
         
     | 
| 
       7 
     | 
    
         
            -
                def self.delete(*a, **k) = $mudis.delete(*a, **k)
         
     | 
| 
       8 
     | 
    
         
            -
                def self.fetch(*a, **k, &b) = $mudis.fetch(*a, **k, &b)
         
     | 
| 
       9 
     | 
    
         
            -
              end
         
     | 
| 
       10 
     | 
    
         
            -
            end
         
     | 
| 
       11 
     | 
    
         
            -
            ```
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
            ```ruby
         
     | 
| 
       14 
     | 
    
         
            -
            # config/puma.rb
         
     | 
| 
       15 
     | 
    
         
            -
            preload_app!
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
            before_fork do
         
     | 
| 
       18 
     | 
    
         
            -
              require_relative "../lib/mudis"
         
     | 
| 
       19 
     | 
    
         
            -
              require_relative "../lib/mudis_server"
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
              Mudis.configure do |c|
         
     | 
| 
       22 
     | 
    
         
            -
                c.serializer = JSON
         
     | 
| 
       23 
     | 
    
         
            -
                c.compress = true
         
     | 
| 
       24 
     | 
    
         
            -
                c.max_value_bytes = 2_000_000
         
     | 
| 
       25 
     | 
    
         
            -
                c.hard_memory_limit = true
         
     | 
| 
       26 
     | 
    
         
            -
                c.max_bytes = 1_073_741_824
         
     | 
| 
       27 
     | 
    
         
            -
              end
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
              Mudis.start_expiry_thread(interval: 60)
         
     | 
| 
       30 
     | 
    
         
            -
              MudisServer.start!
         
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
              at_exit { Mudis.stop_expiry_thread }
         
     | 
| 
       33 
     | 
    
         
            -
            end
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
            on_worker_boot do
         
     | 
| 
       36 
     | 
    
         
            -
              require_relative "../lib/mudis_client"
         
     | 
| 
       37 
     | 
    
         
            -
              $mudis = MudisClient.new
         
     | 
| 
       38 
     | 
    
         
            -
            end
         
     | 
| 
       39 
     | 
    
         
            -
            ```
         
     |