Repository: actix/actix (language: rust)

Issue:
re-export runtime crate
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1. import  actix::prelude
2. Follow the message tutorial

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->

* Rust Version (I.e, output of `rustc -V`): rustc 1.47.0-nightly (6c8927b0c 2020-07-26)
* Actix Version:  actix = "0.10.0-alpha.3"



Discussion / hints:
I fixed the problem by importing actix rt. Could you improve the tutorial. 
Hm this makes me think about re-exporting `actix-rt` like `actix-web`.
Exactly what I thought thanks!

Fix patch:
diff --git a/CHANGES.md b/CHANGES.md
index 022c96bb0..c5fbd2cec 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -13,7 +13,8 @@
 * Allow creating `WeakRecipient` from `WeakAddr`, similiar to `Recipient` from `Addr`. [#432]
 * Send `SyncArbiter` to current `System`'s `Arbiter` and run it as future there. Enabling nested `SyncArbiter`s [#439] 
 * Use generic type instead of associate type for `EnvelopeProxy`. `SyncEnvelopeProxy` and `SyncContextEnvelope` are no 
-  longer bound to Actor. [#445] 
+  longer bound to Actor. [#445]
+* Re-export `actix_rt::main` macro as `actix::main` [#448]
 
 [#421]: https://github.com/actix/actix/pull/421
 [#424]: https://github.com/actix/actix/pull/424
@@ -22,6 +23,7 @@
 [#435]: https://github.com/actix/actix/pull/435
 [#439]: https://github.com/actix/actix/pull/439
 [#445]: https://github.com/actix/actix/pull/445
+[#448]: https://github.com/actix/actix/pull/448
 
 
 ## 0.10.0 - 2020-09-10
diff --git a/Cargo.toml b/Cargo.toml
index 8839cb221..e28f61614 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,6 +35,7 @@ mailbox_assert = []
 [dependencies]
 actix-rt = "1.1.1"
 actix_derive = { version = "0.5", optional = true }
+actix-macros = { version = "0.1.3", features = ["actix-reexport"] }
 
 bytes = "0.5.3"
 crossbeam-channel = "0.4"
diff --git a/README.md b/README.md
index 29e86a273..f0c90de37 100644
--- a/README.md
+++ b/README.md
@@ -107,7 +107,7 @@ for more information on the actor lifecycle.
 An Actor communicates with another Actor by sending messages. In actix all messages
 are typed. Let's define a simple `Sum` message with two `usize` parameters,
 and an actor which will accept this message and return the sum of those two numbers.
-Here we use the [actix-rt](https://github.com/actix/actix-net) as way start our `System`
+Here we use the `#[actix::main]` as way start our `System`
 and drive our main `Future` so we can easily `.await` for the messages sent to the `Actor`.
 
 ```rust
@@ -134,7 +134,7 @@ impl Handler<Sum> for Summator {
     }
 }
 
-#[actix_rt::main] // <- starts the system and block until future resolves
+#[actix::main] // <- starts the system and block until future resolves
 async fn main() {
     let addr = Summator.start();
     let res = addr.send(Sum(10, 5)).await; // <- send message and get future for result
diff --git a/examples/chat/src/client.rs b/examples/chat/src/client.rs
index a8abca14c..7dd6a70f3 100644
--- a/examples/chat/src/client.rs
+++ b/examples/chat/src/client.rs
@@ -11,7 +11,7 @@ use tokio_util::codec::FramedRead;
 
 mod codec;
 
-#[actix_rt::main]
+#[actix::main]
 async fn main() {
     println!("Running chat client");
 
diff --git a/examples/chat/src/main.rs b/examples/chat/src/main.rs
index c4887d869..3b7a1f1b4 100644
--- a/examples/chat/src/main.rs
+++ b/examples/chat/src/main.rs
@@ -49,7 +49,7 @@ impl Handler<TcpConnect> for Server {
     }
 }
 
-#[actix_rt::main]
+#[actix::main]
 async fn main() {
     // Start chat server actor
     let server = ChatServer::default().start();
diff --git a/examples/fibonacci.rs b/examples/fibonacci.rs
index 854afdc5e..f7ff52a5f 100644
--- a/examples/fibonacci.rs
+++ b/examples/fibonacci.rs
@@ -41,7 +41,7 @@ impl Handler<Fibonacci> for SyncActor {
     }
 }
 
-#[actix_rt::main]
+#[actix::main]
 async fn main() {
     // start sync arbiter with 3 threads
     let addr = SyncArbiter::start(3, || SyncActor);
diff --git a/examples/ping.rs b/examples/ping.rs
index c36d1c670..ad1fa2265 100644
--- a/examples/ping.rs
+++ b/examples/ping.rs
@@ -27,7 +27,7 @@ impl Handler<Ping> for MyActor {
     }
 }
 
-#[actix_rt::main]
+#[actix::main]
 async fn main() {
     // start new actor
     let addr = MyActor { count: 10 }.start();
diff --git a/examples/weak_addr.rs b/examples/weak_addr.rs
index ff7976683..b56eea11c 100644
--- a/examples/weak_addr.rs
+++ b/examples/weak_addr.rs
@@ -111,7 +111,7 @@ impl Handler<TimePing> for Client {
     }
 }
 
-#[actix_rt::main]
+#[actix::main]
 async fn main() {
     {
         println!("🎩 creating client client");
diff --git a/examples/weak_recipient.rs b/examples/weak_recipient.rs
index 4b8aad319..01e606836 100644
--- a/examples/weak_recipient.rs
+++ b/examples/weak_recipient.rs
@@ -1,9 +1,9 @@
 //! WeakRecipient example
 //!
-//! With a weak recipent you can register any client actor's addrs with a
+//! With a weak recipient you can register any client actor's addrs with a
 //! service and still get cleaned up correctly when the client actor is
 //! stopped. In contrast to a `WeakAddr` the Service is not bound to know
-//! exactly which type of client actor is registring itself.
+//! exactly which type of client actor is registering itself.
 
 use actix::{prelude::*, WeakRecipient};
 use actix::{Actor, Context};
@@ -153,7 +153,7 @@ impl Handler<TimePing> for ClientB {
     }
 }
 
-#[actix_rt::main]
+#[actix::main]
 async fn main() {
     {
         println!("🎩 creating client client A");
diff --git a/src/actors/resolver.rs b/src/actors/resolver.rs
index 10288def0..6a0209af0 100644
--- a/src/actors/resolver.rs
+++ b/src/actors/resolver.rs
@@ -6,7 +6,7 @@
 //! use actix::actors::resolver;
 //! use actix::prelude::*;
 //!
-//! #[actix_rt::main]
+//! #[actix::main]
 //! async fn main() {
 //!     Arbiter::spawn(async {
 //!         let resolver = resolver::Resolver::from_registry();
diff --git a/src/lib.rs b/src/lib.rs
index 77d34a66c..09f19254c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -69,13 +69,13 @@ pub mod registry;
 pub mod sync;
 pub mod utils;
 
+pub use actix_macros::main;
 pub use actix_rt::{Arbiter, System, SystemRunner};
 
 pub use crate::actor::{
     Actor, ActorContext, ActorState, AsyncContext, Running, SpawnHandle, Supervised,
 };
 pub use crate::address::{Addr, MailboxError, Recipient, WeakAddr, WeakRecipient};
-// pub use crate::arbiter::{Arbiter, ArbiterBuilder};
 pub use crate::context::Context;
 pub use crate::fut::{ActorFuture, ActorStream, FinishStream, WrapFuture, WrapStream};
 pub use crate::handler::{
@@ -105,6 +105,7 @@ pub mod prelude {
     #[cfg(feature = "derive")]
     pub use actix_derive::*;
 
+    pub use actix_macros::main;
     pub use actix_rt::{Arbiter, System, SystemRunner};
 
     pub use crate::actor::{


Test patch: