Skip to content

Commit d4b2df8

Browse files
committed
Merged across networking lib from Master
2 parents 0aa1030 + d1ee641 commit d4b2df8

13 files changed

Lines changed: 1681 additions & 0 deletions
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="INetworkRequestManager.cs" company="MADE Apps">
3+
// Copyright (c) MADE Apps.
4+
// </copyright>
5+
// <summary>
6+
// Defines an interface for a network request manager.
7+
// </summary>
8+
// --------------------------------------------------------------------------------------------------------------------
9+
10+
namespace MADE.App.Networking
11+
{
12+
using System;
13+
using System.Collections.Concurrent;
14+
15+
using MADE.App.Networking.Requests;
16+
17+
/// <summary>
18+
/// Defines an interface for a network request manager.
19+
/// </summary>
20+
public interface INetworkRequestManager
21+
{
22+
/// <summary>
23+
/// Gets the current queue of network requests.
24+
/// </summary>
25+
ConcurrentDictionary<string, NetworkRequestCallback> CurrentQueue { get; }
26+
27+
/// <summary>
28+
/// Starts the manager processing the queue of network requests at a default time period of 1 minute.
29+
/// </summary>
30+
void Start();
31+
32+
/// <summary>
33+
/// Starts the manager processing the queue of network requests.
34+
/// </summary>
35+
/// <param name="processPeriod">
36+
/// The time period between each process of the queue.
37+
/// </param>
38+
void Start(TimeSpan processPeriod);
39+
40+
/// <summary>
41+
/// Stops the processing of the network manager queues.
42+
/// </summary>
43+
void Stop();
44+
45+
/// <summary>
46+
/// Adds or updates a network request in the queue.
47+
/// </summary>
48+
/// <typeparam name="TRequest">
49+
/// The type of network request.
50+
/// </typeparam>
51+
/// <typeparam name="TResponse">
52+
/// The expected response type.
53+
/// </typeparam>
54+
/// <param name="request">
55+
/// The network request to execute.
56+
/// </param>
57+
/// <param name="successCallback">
58+
/// The action to execute when receiving a successful response.
59+
/// </param>
60+
void AddOrUpdate<TRequest, TResponse>(TRequest request, Action<TResponse> successCallback)
61+
where TRequest : NetworkRequest;
62+
63+
/// <summary>
64+
/// Adds or updates a network request in the queue.
65+
/// </summary>
66+
/// <typeparam name="TRequest">
67+
/// The type of network request.
68+
/// </typeparam>
69+
/// <typeparam name="TResponse">
70+
/// The expected response type.
71+
/// </typeparam>
72+
/// <typeparam name="TErrorResponse">
73+
/// The expected error response type.
74+
/// </typeparam>
75+
/// <param name="request">
76+
/// The network request to execute.
77+
/// </param>
78+
/// <param name="successCallback">
79+
/// The action to execute when receiving a successful response.
80+
/// </param>
81+
/// <param name="errorCallback">
82+
/// The action to execute when receiving an error response.
83+
/// </param>
84+
void AddOrUpdate<TRequest, TResponse, TErrorResponse>(
85+
TRequest request,
86+
Action<TResponse> successCallback,
87+
Action<TErrorResponse> errorCallback)
88+
where TRequest : NetworkRequest;
89+
90+
/// <summary>
91+
/// Processes the current queue of network requests.
92+
/// </summary>
93+
void ProcessCurrentQueue();
94+
}
95+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0;uap10.0.16299</TargetFrameworks>
5+
</PropertyGroup>
6+
7+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
8+
<DocumentationFile>bin\Debug\netstandard2.0\MADE.App.Networking.xml</DocumentationFile>
9+
</PropertyGroup>
10+
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
12+
<DocumentationFile>bin\Release\netstandard2.0\MADE.App.Networking.xml</DocumentationFile>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<Compile Remove="api\**" />
17+
<Compile Remove="articles\**" />
18+
<Compile Remove="_site\**" />
19+
<EmbeddedResource Remove="api\**" />
20+
<EmbeddedResource Remove="articles\**" />
21+
<EmbeddedResource Remove="_site\**" />
22+
<None Remove="api\**" />
23+
<None Remove="articles\**" />
24+
<None Remove="_site\**" />
25+
</ItemGroup>
26+
27+
<PropertyGroup>
28+
<LogFile>Docfx-$(TargetFramework).log</LogFile>
29+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
30+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
31+
<Version>1.0.0.0</Version>
32+
<Authors>MADE Apps</Authors>
33+
<Company>MADE Apps</Company>
34+
<Product>MADE App Networking Library</Product>
35+
<Description>Making App Development Easier with a collection of easy to use APIs for working with networking requests for .NET projects across Windows, Android, and iOS.</Description>
36+
<Copyright>Copyright (C) MADE Apps. All rights reserved.</Copyright>
37+
<PackageLicenseUrl>https://github.com/MADE-Apps/MADE-App-Components/blob/master/LICENSE</PackageLicenseUrl>
38+
<PackageProjectUrl>https://github.com/MADE-Apps/MADE-App-Components</PackageProjectUrl>
39+
<RepositoryUrl>https://github.com/MADE-Apps/MADE-App-Components</RepositoryUrl>
40+
<RepositoryType>git</RepositoryType>
41+
<PackageIconUrl>https://pbs.twimg.com/profile_images/927154020422160385/6HSRU36P_400x400.jpg</PackageIconUrl>
42+
<PackageTags>MADE App Development View Networking HttpClient Windows Android iOS Xamarin</PackageTags>
43+
</PropertyGroup>
44+
45+
<ItemGroup>
46+
<None Remove=".gitignore" />
47+
<None Remove="docfx.json" />
48+
<None Remove="index.md" />
49+
<None Remove="log.txt" />
50+
<None Remove="toc.yml" />
51+
<None Remove="Docfx-*.log" />
52+
</ItemGroup>
53+
54+
<ItemGroup>
55+
<PackageReference Include="docfx.console" Version="2.36.0" PrivateAssets="All" />
56+
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.5.4" PrivateAssets="All" />
57+
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
58+
</ItemGroup>
59+
60+
<ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0.16299' ">
61+
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.4" />
62+
</ItemGroup>
63+
64+
<ItemGroup>
65+
<ProjectReference Include="..\MADE.App\MADE.App.csproj" />
66+
</ItemGroup>
67+
68+
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
69+
70+
</Project>

0 commit comments

Comments
 (0)