Float.TinCan.QueuedLRS
2.0.0
dotnet add package Float.TinCan.QueuedLRS --version 2.0.0
NuGet\Install-Package Float.TinCan.QueuedLRS -Version 2.0.0
<PackageReference Include="Float.TinCan.QueuedLRS" Version="2.0.0" />
paket add Float.TinCan.QueuedLRS --version 2.0.0
#r "nuget: Float.TinCan.QueuedLRS, 2.0.0"
// Install Float.TinCan.QueuedLRS as a Cake Addin
#addin nuget:?package=Float.TinCan.QueuedLRS&version=2.0.0
// Install Float.TinCan.QueuedLRS as a Cake Tool
#tool nuget:?package=Float.TinCan.QueuedLRS&version=2.0.0
Float.TinCan.QueuedLRS
The QueuedLRS
is an LRS queue for holding or batching statements before passing onto another ILRS
implementation (e.g. RemoteLRS
). Statements are queued locally until the target LRS confirms successful receipt of the statements. Any queued statements are also written to disk so that the queue can persist across sessions.
The queue will store statements indefinitely until the queue has been flushed. At that point, a batch of statements will be forwarded to the target LRS. If the statements were successfully received, then those statements are removed from the local queue. If an error occurs, those statements will be kept in the queue and sent again later.
QueuedLRS
is a great option for a mobile application looking to store statements offline and send to an LRS when an internet connection is available.
Building
First you must restore the nuget libraries
dotnet restore
This project can be built using Visual Studio for Mac or Cake. It is recommended that you build this project by invoking the bootstrap script:
./build.sh
There are a number of optional arguments that can be provided to the bootstrapper that will be parsed and passed on to Cake itself. See the Cake build file in order to identify all supported parameters.
./build.sh \
--task=Build \
--projectName=Float.TinCan.QueuedLRS \
--configuration=Debug \
--nugetUrl=https://nuget.org \
--nugetToken=####
Installing
NuGet
This library is available as a NuGet via nuget.org.
Usage
Quick Start
using Float.TinCan;
using Float.TinCan.QueuedLRS;
var remoteLRS = new RemoteLRS("http://example.com/xapi-endpoint/", "my app id", "my app secret");
var storePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "statement-store.json");
var queuedLRS = new QueuedLRS(remoteLRS, new JSONStatementStore(storePath));
Statements can now be queued by calling:
queuedLRS.SaveStatement(myStatement);
The queued statement will be stored locally and sent to the LRS when the queue is flushed.
Flushing the Queue
“Flushing” the queue refers to attempting to send queued statements to the target LRS. Applications can manually flush the queue by calling FlushStatementQueueWithResult()
.
When the queue is flushed, a batch of statements (by default, 50 at at time) are sent to the target LRS.
Applications can also define Triggers for automatically flushing the queue at various points during it’s lifecycle.
Additionally, the queue is automatically flushed when querying statements from the LRS
Triggers
The queue is automatically flushed when any of the defined triggers (IQueueFlushTrigger
) is fired. Applications can define their own triggers, but three triggers are included by default:
- PeriodicTrigger — sends statements to the LRS periodically (e.g. every 1 minute)
- CompletedStatementTrigger — sends statements to the LRS when a statement is stored that has the
completed
verb - InternetConnectionTrigger — sends statements to the LRS when an network connection becomes available after previously being unavailable
Statement Validation
Because statements will not be sent to the LRS until later, statements that are queued are put through a rudimentary validation test to ensure that they are properly formatted.
However, even with performing a local validation of statements, it is possible that the target LRS will still reject the statements when the queue is being flushed. This is currently an unrecoverable error for the queued LRS and these statements must be discarded.
License
All content in this repository is shared under an MIT license. See license.md for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Float.TinCan (>= 1.0.3.30)
-
net6.0
- Float.TinCan (>= 1.0.3.30)
-
net7.0
- Float.TinCan (>= 1.0.3.30)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.