Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Adding tryout project
Browse files Browse the repository at this point in the history
  • Loading branch information
ayende committed Jan 14, 2011
1 parent a1f9e2a commit e33bca5
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Raven.MQ.Client/IRavenMQConnection.cs
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Raven.Abstractions.Data;

namespace Raven.MQ.Client
{
public interface IRavenMQConnection : IDisposable
{
Task ConnectToServerTask { get; }
IDisposable Subscribe(string queue, Action<IRavenMQContext, OutgoingMessage> action);
Task PublishAsync(IncomingMessage msg);
Task PublishMessagesAsync(IEnumerable<IncomingMessage> msgs);
}
}
29 changes: 29 additions & 0 deletions Raven.MQ.Tryouts/Program.cs
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raven.Abstractions.Data;
using Raven.MQ.Client;

namespace Raven.MQ.Tryouts
{
class Program
{
static void Main(string[] args)
{
using(var connection = RavenMQConnection.Connect("http://reduction:8181"))
{
connection.Subscribe("/queues/abc", (context, message) =>
Console.WriteLine(Encoding.UTF8.GetString(message.Data)));

connection.PublishAsync(new IncomingMessage
{
Queue = "/queues/abc",
Data = Encoding.UTF8.GetBytes("Hello Ravens")
});

Console.ReadLine();
}
}
}
}
67 changes: 67 additions & 0 deletions Raven.MQ.Tryouts/Raven.MQ.Tryouts.csproj
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Raven.MQ.Tryouts</RootNamespace>
<AssemblyName>Raven.MQ.Tryouts</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</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|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Raven.Abstractions\Raven.Abstractions.csproj">
<Project>{792DB9EB-4B5F-4AF4-BACC-FF842A8DB722}</Project>
<Name>Raven.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\Raven.MQ.Client\Raven.MQ.Client.csproj">
<Project>{A8060EAC-0448-4F52-82AE-6A4D62D5082C}</Project>
<Name>Raven.MQ.Client</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>
12 changes: 12 additions & 0 deletions RavenMQ.sln
Expand Up @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raven.MQ.Server", "Raven.MQ
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raven.MQ.Client", "Raven.MQ.Client\Raven.MQ.Client.csproj", "{A8060EAC-0448-4F52-82AE-6A4D62D5082C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raven.MQ.Tryouts", "Raven.MQ.Tryouts\Raven.MQ.Tryouts.csproj", "{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -107,6 +109,16 @@ Global
{A8060EAC-0448-4F52-82AE-6A4D62D5082C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{A8060EAC-0448-4F52-82AE-6A4D62D5082C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{A8060EAC-0448-4F52-82AE-6A4D62D5082C}.Release|x86.ActiveCfg = Release|Any CPU
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Debug|Any CPU.ActiveCfg = Debug|x86
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Debug|Mixed Platforms.Build.0 = Debug|x86
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Debug|x86.ActiveCfg = Debug|x86
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Debug|x86.Build.0 = Debug|x86
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Release|Any CPU.ActiveCfg = Release|x86
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Release|Mixed Platforms.ActiveCfg = Release|x86
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Release|Mixed Platforms.Build.0 = Release|x86
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Release|x86.ActiveCfg = Release|x86
{40F539FD-39BB-4D76-BDCF-4A82A26A0D01}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit e33bca5

Please sign in to comment.