Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add request traits #39

Merged
merged 2 commits into from
Sep 8, 2024
Merged

feat!: add request traits #39

merged 2 commits into from
Sep 8, 2024

Conversation

tqwewe
Copy link
Owner

@tqwewe tqwewe commented Sep 8, 2024

Moves request send methods into separate traits including:

  • MessageSend (send)
  • MessageSendSync (send_sync)
  • TryMessageSend (try_send)
  • TryMessageSendSync (try_send_sync)
  • BlockingMessageSend (blocking_send)
  • TryBlockingMessageSend (try_blocking_send)
  • ForwardMessageSend (forward)

These traits are implemented given the following features:

Method Ask (bounded) Ask (unbounded) Tell (bounded) Tell (unbounded)
send ✅ 📬 ⏳ 🌐 ✅ ⏳ 🌐 ✅ 📬 🌐 ✅ 🌐
send_sync
try_send ✅ ⏳ 🌐 ✅ ⏳ 🌐 ✅ 🌐 ✅ 🌐
try_send_sync
blocking_send
try_blocking_send
forward ✅ 📬

This rework has heavily influced some internals including remote messaging. One downside to the PR is that sending messages requires you to import the trait into your module. However the fact that sending uses traits now allows some powerful Rust patterns with Kameo.

@tqwewe tqwewe merged commit 51d864e into main Sep 8, 2024
@tqwewe tqwewe deleted the feat/requests branch September 8, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant