Replace all usages of !! by ?
The !! is still used in a lot of locations causing a lot of deprecated warnings in sbt.
Leave a comment
on 2011-07-13 12:56 *
By pveentjer
Assigned to changed from pveentjer to viktorklang
Status changed from New to Test
I had some problems getting the changes in (forgot a git commit at the correct location), but eventually all is in:
https://github.com/jboner/akka/commit/5238caf25a1e6d6ce47f4eea3975f37a3c1f2770
If you look at the changes, you will not see the replacement of !! by ?, but if you open the files, you will see that they have been replaced. I guess this was caused by my git fuckup.
https://github.com/jboner/akka/commit/5238caf25a1e6d6ce47f4eea3975f37a3c1f2770
If you look at the changes, you will not see the replacement of !! by ?, but if you open the files, you will see that they have been replaced. I guess this was caused by my git fuckup.
on 2011-07-14 09:54 *
By viktorklang
What about in comments?
"* <li>If the exchange pattern is out-capable and
"* <li>If the exchange pattern is out-capable and
blocking
is set totrue
then the producer waits for a reply, using the !! operator.</li>"
If this ticket is fixed, you could remove:
/**
@deprecated("use `(actor ? msg).as[T]` instead", "1.2")
def !!(message: Any, timeout: Long = this.timeout)(implicit channel: UntypedChannel = NullChannel): Option[Any] = {
if (isRunning) {
val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, timeout, channel)
try { future.await.resultOrException } catch { case e: FutureTimeoutException ⇒ None }
} else throw new ActorInitializationException(
"Actor has not been started, you need to invoke 'actor.start()' before using it")
}
from ActorRef.scala, and verify that there's no errors and then close this ticket. Thanks
/**
- Sends a message asynchronously and waits on a future for a reply message.
- <p/>
- It waits on the reply either until it receives it (in the form of
Some(replyMessage)
)- or until the timeout expires (which will return None). E.g. send-and-receive-eventually semantics.
- <p/>
- <b>NOTE:</b>
- Use this method with care. In most cases it is better to use '!' together with the 'sender' member field to
- implement request/response message exchanges.
- If you are sending messages using
!!
then you <b>have to</b> use self.reply(..)
- to send a reply message to the original sender. If not then the sender will block until the timeout expires.
@deprecated("use `(actor ? msg).as[T]` instead", "1.2")
def !!(message: Any, timeout: Long = this.timeout)(implicit channel: UntypedChannel = NullChannel): Option[Any] = {
if (isRunning) {
val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, timeout, channel)
try { future.await.resultOrException } catch { case e: FutureTimeoutException ⇒ None }
} else throw new ActorInitializationException(
"Actor has not been started, you need to invoke 'actor.start()' before using it")
}
from ActorRef.scala, and verify that there's no errors and then close this ticket. Thanks
The code was removed:
https://github.com/jboner/akka/commit/0e933d244240bfbd95c215d7730982aeb0ef7715
The strange thing is that my commit a lot of stuff I did not change. According to my dirty list, only the ActorRef.scala was changed (contains the !!).
I did the following:
git checkout -b wip-1018
make changes
git add on all new files
git commit -a -m "blabla"
git checkout master
git merge wip-1018
sbt clean test
git push... here I got an error that I was out of sync.
git pull
sbt clean update test
git push
https://github.com/jboner/akka/commit/0e933d244240bfbd95c215d7730982aeb0ef7715
The strange thing is that my commit a lot of stuff I did not change. According to my dirty list, only the ActorRef.scala was changed (contains the !!).
I did the following:
git checkout -b wip-1018
make changes
git add on all new files
git commit -a -m "blabla"
git checkout master
git merge wip-1018
sbt clean test
git push... here I got an error that I was out of sync.
git pull
sbt clean update test
git push
Perhaps this commit link is better:
https://github.com/jboner/akka/commit/43b3c1f6f8c7f5ef055495cb391a888c3300a597
Shows only a single file being changed.
https://github.com/jboner/akka/commit/43b3c1f6f8c7f5ef055495cb391a888c3300a597
Shows only a single file being changed.
Updating tickets (#967, #974, #975, #976, #980, #981, #989, #990, #992, #993, #994, #999, #1000, #1004, #1008, #1011, #1015, #1018, #1022, #1023, #1024, #1025, #1027, #1028, #1029, #1030, #1032, #1033, #1036, #1047, #1053, #1062, #1067, #1068, #1069, #1072, #1075, #1078, #1082, #1102, #1107, #1110, #1111, #1115, #1116, #1121, #1122, #1123, #1124)