Skip to content

Commit

Permalink
docs: add new theme (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrasseur-aneo authored Jun 7, 2023
2 parents 46d5ffd + 691ae8d commit 7a8d9fe
Show file tree
Hide file tree
Showing 45 changed files with 9,861 additions and 1,764 deletions.
4 changes: 4 additions & 0 deletions .docs/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
node_modules
.output
.nuxt
8 changes: 8 additions & 0 deletions .docs/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
root: true,
extends: '@nuxt/eslint-config',
rules: {
'vue/max-attributes-per-line': 'off',
'vue/multi-word-component-names': 'off'
}
}
13 changes: 13 additions & 0 deletions .docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules
*.iml
.idea
*.log*
.nuxt
.vscode
.DS_Store
coverage
dist
sw.*
.env
.output
.eslintcache
18 changes: 18 additions & 0 deletions .docs/.markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Default state for all rules
default: true
# Disable max line length
MD013: false
# Disable space after hash on atx style heading
MD018: false
# Allow duplicated heading for different sections
MD024:
allow_different_nesting: true
siblings_only: true
# Allow multiple top-level headings
MD025: false
# Allow inline HTML
MD033: false
# Allow non blank lines around list
MD032: false
MD046:
style: fenced
3 changes: 3 additions & 0 deletions .docs/.markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/node_modules

content/0.index.md
2 changes: 2 additions & 0 deletions .docs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
29 changes: 29 additions & 0 deletions .docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ArmoniK.Extensions.Csharp Docs

Docs for ArmoniK.Extensions.Csharp

## Installation

> Be aware to be in the .docs folder
```bash
pnpm install
```

> If you don't have pnpm installed, you can install it with the following command: `npm install -g pnpm`
## Usage

To run the docs locally, run the following command:

```bash
pnpm run dev
```

To build the docs, run the following command:

```bash
pnpm run generate
```

For more information, check out the [armonik-docs-theme documentation](https://aneoconsulting.github.io/armonik-docs-theme).
15 changes: 15 additions & 0 deletions .docs/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default defineAppConfig({
docus: {
title: "ArmoniK.Extensions.Csharp",
description: "An extension library for C# to use ArmoniK",
titleTemplate: "%s - ArmoniK.Extensions.Csharp",
socials: {
github: 'aneoconsulting/ArmoniK.Extensions.Csharp',
},
github: {
dir: '.docs/content',
repo: 'ArmoniK.Extensions.Csharp',
owner: 'aneoconsulting',
},
}
})
22 changes: 22 additions & 0 deletions .docs/content/0.index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
navigation: false
layout: page
main.fluid: false
---

::block-hero
---
cta:
- Get Started
- /buffersubmit
secondary:
- Open on GitHub →
- https://github.com/aneoconsulting/ArmoniK.Extensions.Csharp
---

#title
Extensions Csharp

#description
An extension library for C# to use ArmoniK
::
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<!-- @case-police-ignore Grpc -->

# Buffering submission

## Introduction

A feature in Armonik.Extensions.Csharp allows buffered submission of tasks even if the submission calls are made iteratively. It is possible for the client to buffer task submissions when sending them.

In the situation where a client cannot control its iterative task submission calls, two function calls named ```public async Task<string> SubmitAsync(...)``` have been made available in ArmoniK.DevelopmentKit.Client.Unified.
In the situation where a client cannot control its iterative task submission calls, two function calls named ```public async Task<string> SubmitAsync(...)``` have been made available in ArmoniK.DevelopmentKit.Client.Unified.

The asynchronous methods SubmitAsync allows first to iteratively submit tasks without waiting for the taskId results.
The asynchronous methods SubmitAsync allows first to iteratively submit tasks without waiting for the taskId results.
The buffer is submitted when it is full, or after a specified time, whichever comes first. When it is sent after the specified time, the buffer might not be full.
A new buffer will then be made available to create a new batch of sends

## Buffer configuration

The buffering can be set from the object `Properties` provided when the Service is created
Here below an example of configuration :
Here below an example of configuration :

```csharp
var props = new Properties(TaskOptions,
configuration.GetSection("Grpc")["EndPoint"])
Expand All @@ -23,6 +27,7 @@ var props = new Properties(TaskOptions,
TimeTriggerBuffer = TimeSpan.FromSeconds(10),
};
```

where :
`MaxConcurrentBuffer` is the number of buffers that can be filled in asynchronous submitAsync calls

Expand All @@ -35,34 +40,35 @@ where :
In this example there are 10 buffers of 50 tasks each that will be sent over 5 Grpc channels in parallel. In other words, 2 buffers of 50 tasks will be prepared per Grpc channel

## Submission method

The functions are the following:

The method below will asynchronously send the task without arguments serialization

```csharp
public async Task<string> SubmitAsync(string methodName,
byte[] argument,
IServiceInvocationHandler handler,
CancellationToken token = default)
```


The method below will asynchronously send the task and serialize arguments objects

```csharp
public async Task<string> SubmitAsync(string methodName,
object[] argument,
IServiceInvocationHandler handler,
CancellationToken token = default)
```




## Example
Find below an example to configure and send tasks iteratively with buffering

Find below an example to configure and send tasks iteratively with buffering

### Creation and configuration Unified service

This is the instanciation and configuration of Unified service

```csharp
public class StressTests
{
Expand Down Expand Up @@ -103,8 +109,10 @@ This is the instanciation and configuration of Unified service
ResultHandle = new ResultForStressTestsHandler(Logger);
}
```

### Example of execution tasks
Here is the complete code to send a list of tasks :

Here is the complete code to send a list of tasks :

```csharp
/// <summary>
Expand Down Expand Up @@ -161,7 +169,8 @@ Here is the complete code to send a list of tasks :

```

### Result task handler
### Result task handler

```csharp
private class ResultForStressTestsHandler : IServiceInvocationHandler
{
Expand Down Expand Up @@ -218,8 +227,8 @@ Here is the complete code to send a list of tasks :
}
```

### Result output will be

### Result output will be
<details><summary>Uncollapse output</summary>
<p>

Expand Down Expand Up @@ -259,5 +268,6 @@ Here is the complete code to send a list of tasks :
[11:07:46 INF] Got 224 results. All tasks submitted ? True
[11:07:46 INF] Total result is 9407.98365779803
```

</p>
</details>
25 changes: 25 additions & 0 deletions .docs/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const baseURL = process.env.NODE_ENV === 'production' ? '/ArmoniK.Extensions.Csharp/' : '/'

export default defineNuxtConfig({
extends: '@aneoconsultingfr/armonik-docs-theme',

app: {
baseURL: baseURL,
head: {
link: [
{
rel: 'icon',
type: 'image/ico',
href: `${baseURL}favicon.ico`,
}
]
}
},

runtimeConfig: {
public: {
siteName: 'ArmoniK.Extensions.Csharp',
siteDescription: 'An extension library for C# to use ArmoniK',
}
},
})
26 changes: 26 additions & 0 deletions .docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "armonik-extensions-csharp",
"private": true,
"scripts": {
"prepare": "nuxi prepare",
"dev": "nuxi dev",
"build": "nuxi build",
"generate": "nuxi generate",
"preview": "nuxi preview",
"lint": "eslint --cache .",
"lint:fix": "eslint --cache --fix .",
"lint:md": "markdownlint . && case-police ./**/*.md",
"lint:md:fix": "markdownlint . --fix && case-police --fix ./**/*.md"
},
"dependencies": {
"@aneoconsultingfr/armonik-docs-theme": "^0.6.9",
"nuxt": "^3.4.3"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.1.1",
"case-police": "^0.6.1",
"eslint": "^8.40.0",
"markdownlint-cli": "^0.34.0"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 7a8d9fe

Please sign in to comment.