add files from iron_sharp #1

Merged
merged 2 commits into from Feb 12, 2014
Jump to file or symbol
Failed to load files and symbols.
+6,060 −2
Split
View
20 LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Jeremy Bell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
156 README.md
@@ -1,2 +1,154 @@
-iron_mq_dotnet
-==============
+![Fe#](http://c577730.r99.cf2.rackcdn.com/images/FeSharp.png)
+==========
+
+# IronSharp is a .NET client for [Iron.io](http://www.iron.io/)
+
+Forked from [grcodemonkey/iron_sharp](https://github.com/grcodemonkey/iron_sharp)
+
+## Getting Started
+
+1. Sign up at <https://hud.iron.io/users/new>
+2. Get your credentials from [https://hud.iron.io/dashboard](https://hud.iron.io/dashboard "Heads up")
+3. Check out the [wiki](https://github.com/grcodemonkey/iron_sharp/wiki "For those that like to read directions")
+
+## IronCache
+<http://dev.iron.io/cache/>
+
+```PM> Install-Package IronSharp.IronCache```
+
+```C#
+// =========================================================
+// Iron.io Cache
+// =========================================================
+
+IronCacheRestClient ironCacheClient = IronSharp.IronCache.Client.New();
+
+// Get a Cache object
+CacheClient cache = ironCacheClient.Cache("my_cache");
+
+// Put value to cache by key
+cache.Put("number_item", 42);
+
+// Get value from cache by key
+Console.WriteLine(cache.Get("number_item").Value);
+
+// Get value from cache by key
+Console.WriteLine(cache.Get<int>("number_item"));
+
+// Numbers can be incremented
+cache.Increment("number_item", 10);
+
+// Immediately delete an item
+cache.Delete("number_item");
+
+cache.Put("complex_item", new {greeting = "Hello", target = "world"});
+
+// Get value from cache by key
+Console.WriteLine(cache.Get("complex_item").Value);
+
+cache.Delete("complex_item");
+```
+
+## IronMQ
+<http://dev.iron.io/mq/>
+
+```PM> Install-Package IronSharp.IronMQ```
+
+```C#
+// =========================================================
+// Iron.io MQ
+// =========================================================
+
+IronMqRestClient ironMq = IronSharp.IronMQ.Client.New();
+
+// Get a Queue object
+QueueClient queue = ironMq.Queue("my_queue");
+
+QueueInfo info = queue.Info();
+
+Console.WriteLine(info.Inspect());
+
+// Put a message on the queue
+string messageId = @queue.Post("hello world!");
+
+Console.WriteLine(messageId);
+
+// Get a message
+QueueMessage msg = queue.Next();
+
+Console.WriteLine(msg.Inspect());
+
+//# Delete the message
+bool deleted = msg.Delete();
+
+Console.WriteLine("Deleted = {0}", deleted);
+
+var payload1 = new
+{
+ message = "hello, my name is Iron.io 1"
+};
+
+var payload2 = new
+{
+ message = "hello, my name is Iron.io 2"
+};
+
+var payload3 = new
+{
+ message = "hello, my name is Iron.io 3"
+};
+
+MessageIdCollection queuedUp = queue.Post(new[] {payload1, payload2, payload3});
+
+Console.WriteLine(queuedUp.Inspect());
+
+QueueMessage next;
+
+while (queue.Read(out next))
+{
+ Console.WriteLine(next.Inspect());
+ Console.WriteLine(next.Delete());
+}
+```
+
+## IronWorker
+<http://dev.iron.io/worker/>
+
+```PM> Install-Package IronSharp.IronWorker```
+
+```C#
+// =========================================================
+// Iron.io Worker
+// =========================================================
+
+IronWorkerRestClient workerClient = IronSharp.IronWorker.Client.New();
+
+string taskId = workerClient.Tasks.Create("Test", new {Key = "Value"});
+
+Console.WriteLine("TaskID: {0}", taskId);
+
+TaskInfoCollection taskInfoCollection = workerClient.Tasks.List("Test");
+
+foreach (TaskInfo task in taskInfoCollection.Tasks)
+{
+ Console.WriteLine(task.Inspect());
+}
+
+ScheduleOptions options = ScheduleBuilder.Build().
+ Delay(TimeSpan.FromMinutes(1)).
+ WithFrequency(TimeSpan.FromHours(1)).
+ RunFor(TimeSpan.FromHours(3)).
+ WithPriority(TaskPriority.Default);
+
+var payload = new
+{
+ a = "b",
+ c = new[] {1, 2, 3}
+};
+
+ScheduleIdCollection schedule = workerClient.Schedules.Create("Test", payload, options);
+
+Console.WriteLine(schedule.Inspect());
+
+workerClient.Schedules.Cancel(schedule.Schedules.First().Id);
+```
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<configuration>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+ </startup>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-2.1.2.0" newVersion="2.1.2.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{4EFB32B2-4CD3-4604-9ADC-458A4FC4C50B}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Demo.IronSharpConsole</RootNamespace>
+ <AssemblyName>Demo.IronSharpConsole</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Common.Logging, Version=2.1.2.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Common.Logging.2.1.2\lib\net40\Common.Logging.dll</HintPath>
+ </Reference>
+ <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="App.config" />
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\IronSharp.Core\IronSharp.Core.csproj">
+ <Project>{1a6cc922-40a5-440a-868d-757fcdb08622}</Project>
+ <Name>IronSharp.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\IronSharp.IronCache\IronSharp.IronCache.csproj">
+ <Project>{2603e861-09ab-482e-bf28-41d8b0b1b20b}</Project>
+ <Name>IronSharp.IronCache</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\IronSharp.IronMQ\IronSharp.IronMQ.csproj">
+ <Project>{d891a220-aa6f-4d0c-b012-b25875787ba0}</Project>
+ <Name>IronSharp.IronMQ</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\IronSharp.IronWorker\IronSharp.IronWorker.csproj">
+ <Project>{4fa5bf5d-c543-404e-89ec-c3bff90acf6b}</Project>
+ <Name>IronSharp.IronWorker</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
Oops, something went wrong.