Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/unyt-org/example-threads

An example that showcases Threads using DATEX and UIX
https://github.com/unyt-org/example-threads

datex multithreading thread uix uix-example unyt

Last synced: about 2 months ago
JSON representation

An example that showcases Threads using DATEX and UIX

Awesome Lists containing this project

README

        

# Example: Threads

This repository demonstrates the concepts of type-safe **Multi-Threading** based on [DATEX](https://datex.unyt.org) and Web Workers.
In this demo, we are calculating the digits of PI and creating a [TOR vanity address](https://community.torproject.org/onion-services/advanced/vanity-addresses/).

## Installation
1. Install the **UIX command line tool** following the [Getting Started](https://docs.unyt.org/manual/uix/getting-started#the-uix-command-line-tool) guide in our documentation.

2. Clone this repository to your local machine:

```bash
$ git clone https://github.com/unyt-org/example-threads.git
```
3. Run the project local
```bash
$ uix --port 8000
```
4. Navigate to your favourite web browser and open http://localhost:8000 to see everything in action.

## Structure
This diagram outlines the UIX default project structure.
```
.
└── example-threads/
├── common/
│ ├── components/
│ │ ├── MainPage.scss // Main style declaration
│ │ └── MainPage.tsx // Main component
│ ├── PI-Worker.ts // Worker for PI calculation
│ └── TOR-Worker.ts // Worker for TOR address gen
├── frontend/
│ ├── entrypoint.css // Front-end style declaration
│ └── entrypoint.tsx // Front-end entrypoint
├── app.dx // Endpoint config file
└── deno.json // Deno config file
```

## Features
* Threading
* Multiple threads
* Disposing of threads

## Preview

---

© unyt 2024 • [unyt.org](https://unyt.org)