GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - perrich/Hangfire.MemoryStorage: A memory storage for Hangfire.

BranchesTags
Open more actions menu

Latest commit

 

History

96 Commits
96 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
.gitignore
.gitignore
 
 
Hangfire.MemoryStorage.nuspec
Hangfire.MemoryStorage.nuspec
 
 
Hangfire.MemoryStorage.sln
Hangfire.MemoryStorage.sln
 
 
LICENSE
LICENSE
 
 
NuGet.Config
NuGet.Config
 
 
README.md
README.md
 
 

Repository files navigation

Hangfire.MemoryStorage

A memory storage for Hangfire (http://hangfire.io).

It can be useful for testing purpose like check the behaviour and use it in a development environment. Please note that :

  • it should not be used in production (no integrity and no thread safe even if many cases are managed).
  • data are stored in memory using a dictionary in a static way (See Data created at the storage creation)
  • Hangfire has its own solution (see https://github.com/HangfireIO/Hangfire.InMemory)

How To use MemoryStorage

GlobalConfiguration.Configuration.UseMemoryStorage();

Example: Set a job now and execute.

Startup Class

public void ConfigureServices(IServiceCollection services)
{   // Add This
    services.AddHangfire(config =>
    {
        config.UseMemoryStorage();
    });
}

 public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{   
    // Add This
    app.UseHangfireDashboard();
    app.UseHangfireServer();
}
static void Main(string[] args)
{
        
   BackgroundJob.Enqueue(() => System.IO.File.WriteAllText(@"..\test.txt","1"));
}

OutPut:

test.txt
1

License:

Copyright 2015 - 2023 PERRICHOT Florian

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A memory storage for Hangfire.

Topics

hangfirememory-storage

Resources

Readme
Apache-2.0 license
Activity

Stars

134 stars

Watchers

6 watching

Forks

45 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.