Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4043a681db | ||
|
|
7cdf52544c | ||
|
|
fa14529aa2 | ||
|
|
4b6e9f35ef | ||
|
|
5684938b4c |
@@ -9,6 +9,7 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
issues: write
|
issues: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
actions: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
"@semantic-release/exec",
|
"@semantic-release/exec",
|
||||||
{
|
{
|
||||||
"prepareCmd": "sed -i 's/^version = \\\"[^\\\"]*\\\"/version = \\\"${nextRelease.version}\\\"/' Cargo.toml && cargo check",
|
"prepareCmd": "sed -i 's/^version = \\\"[^\\\"]*\\\"/version = \\\"${nextRelease.version}\\\"/' Cargo.toml && cargo check",
|
||||||
"successCmd": "gh api -X POST repos/asepharyana/corex/actions/workflows/publish.yml/dispatches -f ref=main -f 'inputs[tag]=v${nextRelease.version}'"
|
"successCmd": "gh api -X POST repos/asepharyana/mytheclipse/actions/workflows/publish.yml/dispatches -f ref=main -f 'inputs[tag]=v${nextRelease.version}'"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -1,3 +1,20 @@
|
|||||||
|
# [1.0.0](https://github.com/asepharyana/mytheclipse/compare/v0.2.4...v1.0.0) (2026-08-28)
|
||||||
|
|
||||||
|
|
||||||
|
* feat!: rename CorexError to MytheclipseError ([7cdf525](https://github.com/asepharyana/mytheclipse/commit/7cdf52544c611b05c6365595a8ae713672706b67))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* CorexError is renamed to MytheclipseError.
|
||||||
|
|
||||||
|
## [0.2.4](https://github.com/asepharyana/corex/compare/v0.2.3...v0.2.4) (2026-08-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **release:** add actions: write permission for workflow dispatch ([5684938](https://github.com/asepharyana/corex/commit/5684938b4cd5a133a57ee835426035a804edcb38))
|
||||||
|
|
||||||
## [0.2.3](https://github.com/asepharyana/corex/compare/v0.2.2...v0.2.3) (2026-08-28)
|
## [0.2.3](https://github.com/asepharyana/corex/compare/v0.2.2...v0.2.3) (2026-08-28)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Generated
+1
-1
@@ -107,7 +107,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mytheclipse"
|
name = "mytheclipse"
|
||||||
version = "0.2.3"
|
version = "1.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"rayon",
|
"rayon",
|
||||||
|
|||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "mytheclipse"
|
name = "mytheclipse"
|
||||||
version = "0.2.3"
|
version = "1.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.75"
|
rust-version = "1.75"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
repository = "https://github.com/asepharyana/corex"
|
repository = "https://github.com/asepharyana/mytheclipse"
|
||||||
homepage = "https://github.com/asepharyana/corex"
|
homepage = "https://github.com/asepharyana/mytheclipse"
|
||||||
documentation = "https://docs.rs/mytheclipse"
|
documentation = "https://docs.rs/mytheclipse"
|
||||||
authors = ["asepharyana <superaseph@gmail.com>"]
|
authors = ["asepharyana <superaseph@gmail.com>"]
|
||||||
description = "Resource-aware abstractions for async I/O, heavy compute, and background queue management."
|
description = "Resource-aware abstractions for async I/O, heavy compute, and background queue management."
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ async fn main() {
|
|||||||
|
|
||||||
let sum_result = mytheclipse::compute(|| (1..=1_000u64).sum::<u64>());
|
let sum_result = mytheclipse::compute(|| (1..=1_000u64).sum::<u64>());
|
||||||
|
|
||||||
let panic_result: Result<u64, mytheclipse::CorexError> = mytheclipse::compute(|| {
|
let panic_result: Result<u64, mytheclipse::MytheclipseError> = mytheclipse::compute(|| {
|
||||||
panic!("intentional panic to demonstrate isolation");
|
panic!("intentional panic to demonstrate isolation");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -3,12 +3,12 @@
|
|||||||
use std::panic::{catch_unwind, AssertUnwindSafe};
|
use std::panic::{catch_unwind, AssertUnwindSafe};
|
||||||
|
|
||||||
use crate::context::context;
|
use crate::context::context;
|
||||||
use crate::error::CorexError;
|
use crate::error::MytheclipseError;
|
||||||
|
|
||||||
/// Runs `f` on the global compute thread pool and returns its result.
|
/// Runs `f` on the global compute thread pool and returns its result.
|
||||||
///
|
///
|
||||||
/// If `f` panics, the panic is caught and converted into
|
/// If `f` panics, the panic is caught and converted into
|
||||||
/// [`CorexError::ComputePanic`] instead of unwinding across the pool
|
/// [`MytheclipseError::ComputePanic`] instead of unwinding across the pool
|
||||||
/// boundary or poisoning the pool; subsequent calls to [`compute`] continue
|
/// boundary or poisoning the pool; subsequent calls to [`compute`] continue
|
||||||
/// to work normally.
|
/// to work normally.
|
||||||
///
|
///
|
||||||
@@ -23,7 +23,7 @@ use crate::error::CorexError;
|
|||||||
/// captured by mutable reference: if `f` panics partway through mutating a
|
/// captured by mutable reference: if `f` panics partway through mutating a
|
||||||
/// captured `&mut T`, that `T` may be left in an inconsistent state from
|
/// captured `&mut T`, that `T` may be left in an inconsistent state from
|
||||||
/// the caller's perspective.
|
/// the caller's perspective.
|
||||||
pub fn compute<F, R>(f: F) -> Result<R, CorexError>
|
pub fn compute<F, R>(f: F) -> Result<R, MytheclipseError>
|
||||||
where
|
where
|
||||||
F: FnOnce() -> R + Send,
|
F: FnOnce() -> R + Send,
|
||||||
R: Send,
|
R: Send,
|
||||||
@@ -32,7 +32,7 @@ where
|
|||||||
context()
|
context()
|
||||||
.compute_pool
|
.compute_pool
|
||||||
.install(move || catch_unwind(wrapped))
|
.install(move || catch_unwind(wrapped))
|
||||||
.map_err(|payload| CorexError::ComputePanic(panic_payload_to_string(payload)))
|
.map_err(|payload| MytheclipseError::ComputePanic(panic_payload_to_string(payload)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn panic_payload_to_string(payload: Box<dyn std::any::Any + Send>) -> String {
|
fn panic_payload_to_string(payload: Box<dyn std::any::Any + Send>) -> String {
|
||||||
@@ -51,8 +51,8 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn compute_panic_is_isolated_and_pool_survives() {
|
fn compute_panic_is_isolated_and_pool_survives() {
|
||||||
let panicked: Result<u32, CorexError> = compute(|| panic!("boom"));
|
let panicked: Result<u32, MytheclipseError> = compute(|| panic!("boom"));
|
||||||
assert!(matches!(panicked, Err(CorexError::ComputePanic(_))));
|
assert!(matches!(panicked, Err(MytheclipseError::ComputePanic(_))));
|
||||||
|
|
||||||
let recovered = compute(|| 1 + 1);
|
let recovered = compute(|| 1 + 1);
|
||||||
assert_eq!(recovered.unwrap(), 2);
|
assert_eq!(recovered.unwrap(), 2);
|
||||||
|
|||||||
+3
-3
@@ -7,7 +7,7 @@
|
|||||||
/// wildcard arm.
|
/// wildcard arm.
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum CorexError {
|
pub enum MytheclipseError {
|
||||||
/// A closure submitted to [`crate::compute::compute`] panicked.
|
/// A closure submitted to [`crate::compute::compute`] panicked.
|
||||||
///
|
///
|
||||||
/// The contained string is a best-effort rendering of the panic
|
/// The contained string is a best-effort rendering of the panic
|
||||||
@@ -15,7 +15,7 @@ pub enum CorexError {
|
|||||||
ComputePanic(String),
|
ComputePanic(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for CorexError {
|
impl std::fmt::Display for MytheclipseError {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Self::ComputePanic(message) => {
|
Self::ComputePanic(message) => {
|
||||||
@@ -25,4 +25,4 @@ impl std::fmt::Display for CorexError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::error::Error for CorexError {}
|
impl std::error::Error for MytheclipseError {}
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ pub mod bg;
|
|||||||
pub use context::{context, EngineContext};
|
pub use context::{context, EngineContext};
|
||||||
|
|
||||||
#[cfg(feature = "compute")]
|
#[cfg(feature = "compute")]
|
||||||
pub use error::CorexError;
|
pub use error::MytheclipseError;
|
||||||
|
|
||||||
#[cfg(feature = "io")]
|
#[cfg(feature = "io")]
|
||||||
pub use io::spawn_io;
|
pub use io::spawn_io;
|
||||||
|
|||||||
Reference in New Issue
Block a user