cnlangzi / gearmansharp Goto Github PK
View Code? Open in Web Editor NEWThis project forked from twingly/gearmansharp
*UNMAINTAINED* C# Gearman API
License: BSD 3-Clause "New" or "Revised" License
This project forked from twingly/gearmansharp
*UNMAINTAINED* C# Gearman API
License: BSD 3-Clause "New" or "Revised" License
GearmanSharp is a C# API for Gearman (http://www.gearman.org). Description =========== GearmanSharp is a C# API for Gearman. Currently it only provides the basic parts of the protocol, but there is enough to build a basic client and worker. In the future, we hope it will provide a more complete implementation of the protocol. It requires .NET 3.5. License ======= Copyright 2010 Twingly AB. GearmanSharp is provided under the three-clause BSD License. See the included LICENSE.txt file for specifics. Source code =========== The source code is located on GitHub at: http://github.com/twingly/GearmanSharp/ Examples ======== For more examples, check: http://github.com/twingly/GearmanSharp/blob/master/GearmanSharp/Examples/Example.cs * Client examples // Create a simple client and add "localhost" as server using (var client = new GearmanClient()) { client.AddServer("localhost"); // You can submit a simple background job client.SubmitBackgroundJob("reverse", Encoding.ASCII.GetBytes("helloworld")); // And you can submit a more advanced job var oembeds = client.SubmitJob<IList<string>, IList<OEmbed>>( "GetOEmbeds", new List<string> { "http://www.youtube.com/watch?v=abc123456" }, Serializers.JsonSerialize<IList<string>>, Serializers.JsonDeserialize<IList<OEmbed>>); } * Worker examples // Create a simple worker and register a function that handles "reverse" var worker = new GearmanWorker(); worker.AddServer("localhost"); worker.RegisterFunction("reverse", ReverseFunction); // Perform one unit of work worker.Work(); // You can also register more advanced functions worker.RegisterFunction<IList<string>, IList<OEmbed>>("GetOEmbeds", GetOembedsFunction, Serializers.JsonDeserialize<IList<string>>, Serializers.JsonSerialize<IList<OEmbed>>); // The function definition and GearmanJob: public void GetOEmbeds(IGearmanJob<IList<string>, IList<OEmbed>> job) { // The FunctionArgument of the job will be an IList<string> IList<string> urls = job.FunctionArgument; // ... // and the Complete(..) function takes an IList<OEmbed> job.Complete(new List<OEmbed>()); } // You can also start a worker in a separate thread var worker = new GearmanThreadedWorker(); // Start the worker thread worker.StartWorkLoop(); // ... do other stuff ... worker.StopWorkLoop();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.