Jinaga.Notebooks
1.0.5
dotnet add package Jinaga.Notebooks --version 1.0.5
NuGet\Install-Package Jinaga.Notebooks -Version 1.0.5
<PackageReference Include="Jinaga.Notebooks" Version="1.0.5" />
paket add Jinaga.Notebooks --version 1.0.5
#r "nuget: Jinaga.Notebooks, 1.0.5"
// Install Jinaga.Notebooks as a Cake Addin #addin nuget:?package=Jinaga.Notebooks&version=1.0.5 // Install Jinaga.Notebooks as a Cake Tool #tool nuget:?package=Jinaga.Notebooks&version=1.0.5
Jinaga.NET
Resilient, reliable data transfer for .NET.
What it Does
In Jinaga, you define a data model in terms of immutable facts. A fact represents an entity, a change to an entity, or a decision that a user or service has made.
In Jinaga.NET, facts are C# record
s.:
[FactType("Corporate.Company")]
record Company(string identifier) {}
[FactType("Corporate.Employee")]
record Employee(Company company, int employeeNumber) {}
When a user or service makes a decision, you will add a fact to the system. This will store it in the local database. It will also update the local UI. And it will publish it so that others can learn about the decision.
var contoso = await j.Fact(new Company("Contoso"));
var jane = await j.Fact(new Employee(contoso, 1));
var bob = await j.Fact(new Employee(contoso, 2));
To query facts, write a specification. Start at a know fact and find all related facts that match that specification.
var employeesOfCompany = Given<Company>.Match((company, facts) =>
from employee in facts.OfType<Employee>()
where employee.company == company
select employee
);
var contosoEmployees = await j.Query(contoso, employeesOfCompany);
A query returns results at a point in time. If you want to keep a user interface up-to-date, you will need to set up an event-based watch.
var observer = j.Watch(contoso, employeesOfCompany, employee =>
{
var component = AddEmployeeComponent(employee);
return () =>
{
RemoveEmployeeComponent(component);
};
});
Finally, if you want to be notified in real time of new information, just change Watch
to Subscribe
.
var subscription = j.Subscribe(contoso, employeesOfCompany, employee =>
{
var component = AddEmployeeComponent(employee);
return () =>
{
RemoveEmployeeComponent(component);
};
});
The client will open a persistent connection with the server. The server will notify the client the moment a new employee is hired. Because the client already set up a watch, the new employee will appear on the UI.
Running a Replicator
A Jinaga front end connects to a device called a Replicator. The Jinaga Replicator is a single machine in a network. It stores and shares facts. To get started, create a Replicator of your very own using Docker.
docker pull jinaga/jinaga-replicator
docker create --name my-replicator -p8080:8080 jinaga/jinaga-replicator
docker start my-replicator
This creates and starts a new container called my-replicator
.
The container is listening at port 8080 for commands.
Configure Jinaga to use the replicator:
var j = JinagaClient.Create(options =>
{
options.HttpEndpoint = new Uri("http://localhost:8080/jinaga");
});
Roadmap
Jinaga.NET is co-evolving with Jinaga.JS. Each of these projects has a front end and a back end. Either front end is intended to work with either back end. And the back ends are intended to interconnect to form a decision substrate.
Storage
Jiaga.NET currently has support for SQLite and memory storage. The next storage solution to implement is PostgreSQL to support Docker deployment. After that, the MS SQL Server implementation will support enterprise solutions that need to keep the journal transactionally consistent with the projection.
Release
This repository uses Nerdbank.GitVersioning to manage version numbers.
To release a new version of the Jinaga.NET library, create a new release in the format yyyymmdd.i
.
For example, 20240917.1
.
All of the packages will be versioned separately.
Their version numbers will not be updated if they have not changed.
The packages will be published to NuGet.
To accomplish this from the command line, use the following gh
command.
gh release create 20240917.1 --generate-notes
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 was computed. 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. |
-
net6.0
- Jinaga (>= 1.0.6)
- Microsoft.AspNetCore.Html.Abstractions (>= 2.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.5 | 114 | 9/20/2024 |
1.0.5-g3fd5de50a5 | 98 | 9/20/2024 |
1.0.0 | 112 | 7/16/2024 |
0.12.8 | 98 | 7/14/2024 |
0.12.7 | 93 | 7/14/2024 |
0.12.6 | 104 | 7/13/2024 |
0.12.5 | 125 | 7/7/2024 |
0.12.4 | 124 | 7/6/2024 |
0.12.4-alpha.0.2 | 50 | 7/6/2024 |