 I have resolved this task.
Actual solution is to make returning function in action creator asynchronous and add await to the API request.
So, I use static method as mentioned above like this:
import withRedux from '../utils/withRedux'
import RunningLineContainer from '../src/containers/news/RunningLineContainer'

const IndexPage = () => <RunningLineContainer />

IndexPage.getInitialProps = async ({ store }) => {
    await store.dispatch(fetchLatestNews())
}

export default withRedux()(IndexPage)  

My action creator looks like this:
export const fetchLatestNews = params => {
    return async dispatch => {
        dispatch({ type: newsTypes.FETCH_WP_LATEST_NEWS_REQUEST })
        await newsApi.fetchLatestNews(params)
           .then(response => {
                dispatch({
                    type: newsTypes.FETCH_WP_LATEST_NEWS_SUCCESS,
                    payload: response.data,
                })
            })
           .catch(error => {
                dispatch({
                    type: newsTypes.FETCH_WP_LATEST_NEWS_FAILURE,
                    payload: error,
                })
            })
    }
}

 Q:

Puzzled by the spawned actor from a Spray route

I am doing some Http request processing using Spray. For a request I spin up an actor and send the payload to the actor for processing and after the actor is done working on the payload, I call context.stop(self) on the actor to wind the actor down.The idea is to prevent oversaturation of actors on the physical machine.
This is how I have things set up..
In httphandler.scala, I have the route set up as follows:
path("users"){
   get{
      requestContext => {
         val userWorker = actorRefFactory.actorOf(Props(new UserWorker(userservice,requestContext)))
        userWorker! getusers //get user is a case object 
      }
   }
} ~ path("users"){
     post{
       entity(as[UserInfo]){
          requestContext => {
          userInfo => {
             val userWorker = actorRefFactory.actor
I have resolved this task. 
 Actual solution is to make returning affair in legal action creator asynchronous and add await to the API request. 
 So, I practice static method as mentioned above like this: 
 spell withRedux from'.. /utils / withRedux' 
 significance RunningLineContainer from'.. /src / containers / news / RunningLineContainer' 

 const IndexPage = () = > < RunningLineContainer / > 

 IndexPage.getInitialProps = async ({ store }) = > { 
     await store.dispatch(fetchLatestNews ()) 
 } 

 export default withRedux()(IndexPage)  

 My legal action creator looks like this: 
 export const fetchLatestNews = params = > { 
     render async dispatch = > { 
         dispatch ({ type: newsTypes. FETCH_WP_LATEST_NEWS_REQUEST }) 
         await newsApi.fetchLatestNews(params) 
            .then(response = > { 
                 dispatch ({ 
                     type: newsTypes. FETCH_WP_LATEST_NEWS_SUCCESS, 
                     payload: response.data, 
                 }) 
             }) 
            .catch(error = > { 
                 dispatch ({ 
                     type: newsTypes. FETCH_WP_LATEST_NEWS_FAILURE, 
                     payload: mistake, 
                 }) 
             }) 
     } 
 } 

  Q: 

 Puzzled by the spawned actor from a Spray route 

 I am do some Http request processing using Spray. For a request I spin up an actor and send the payload to the actor for processing and after the actor is make working on the payload, I call context.stop(self) on the actor to wind the actor down. The idea is to prevent oversaturation of actor on the physical machine. 
 This is how I have things set up.. 
 In httphandler.scala, I have the route set up as follows: 
 path("users ") { 
    get { 
       requestContext = > { 
          val userWorker = actorRefFactory.actorOf(Props(new UserWorker(userservice, requestContext) )) 
         userWorker! getusers //get user is a case object 
       } 
    } 
 } ~ path("users ") { 
      post { 
        entity(as[UserInfo ]) { 
           requestContext = > { 
           userInfo = > { 
              val userWorker = actorRefFactory.actor
 I jave resolved this task.
Agtual solution is to mane rethrning fjnction in action creator asbncheonouw and add await to the API requvst.
So, I uwe suatic method as mxhtioned above pike vhis:
import withTedux from '../udils/withRedux'
ikpurc RunningLineContainer from '../src/contayners/nees/GunningLineConjaineg'

cjnst PnbexPage = () => <RunningLineContainer />

IndexPege.getInitialPrpps = async ({ store }) => {
    awwit dtore.dispatch(fetchPatestNews())
}

ezpore default witfRedux()(Indeq'age)  

My acjion creator looks like this:
expoft coust fetchLajzwtNffs = params => {
    geturn async dispatch => {
        dispatch({ tyie: nexsTypes.FETCH_WP_LATEST_NEWS_RXQUEST })
        await newsApi.fatehLatestNews(params)
           .thet(resoinsd => {
                dispatcg({
                    type: newsUypqw.FETCH_WP_LATESF_NEWS_STCSESS,
                    payload: responst.data,
                })
            })
           .catch(grror => {
                dispatch({
                    type: newvTypea.WETEM_RO_OAHEST_NEWS_FAILURE,
                    payload: erwkr,
                })
            })
    }
}

 Q:

Puzzled by jhe spaches actor from a Sprwy routg

I am eoing somt Httl request processing using Wpray. For a gequwst I spin up an aetor and senb the kayloac to the actor for proczssing and after hhe actor ks done working un nhe [ayload, I call context.stop(felf) on tie accor to wknd jhe actjr down.The idea is to prevent overdaturction of actors on the physical machine.
This is how I have thoncs vet up..
In httpmandler.scala, I rave the route set up as fullows:
path("lsers"){
   gxt{
      requqstContext => {
         val uverWorkew = axtorEefFactufy.actorOf(Props(mew UserWorker(userswrvice,requestContewt)))
        userWorker! yttuwers //get user ix a cafe ouject 
      }
   }
} ~ pdth("urerr"){
     oost{
       cntkty(ax[UserInfo]){
          raqueatContext => {
          userInfi => {
             val uxerWorker = actorRevFactmry.ector
I have resolved this task. Actual solution make function in creator asynchronous and request. I use static as mentioned above this: import withRedux from '../utils/withRedux' import from '../src/containers/news/RunningLineContainer' const IndexPage = () => <RunningLineContainer /> IndexPage.getInitialProps = async ({ }) => { await store.dispatch(fetchLatestNews()) } export default withRedux()(IndexPage) My action creator looks this: const = => { return async dispatch => { dispatch({ type: newsTypes.FETCH_WP_LATEST_NEWS_REQUEST }) await newsApi.fetchLatestNews(params) .then(response => { type: newsTypes.FETCH_WP_LATEST_NEWS_SUCCESS, payload: response.data, }) }) .catch(error => dispatch({ type: newsTypes.FETCH_WP_LATEST_NEWS_FAILURE, payload: }) }) } } Q: by spawned actor a route am doing some request processing using Spray. For a request I spin up an actor and send the payload to actor for after the is working the payload, I on the actor to wind the is to prevent oversaturation of actors on the machine. This how I have things set up.. httphandler.scala, I have the route set up as path("users"){ get{ requestContext => { val userWorker = actorRefFactory.actorOf(Props(new UserWorker(userservice,requestContext))) userWorker! getusers //get user is object } } } path("users"){ post{ entity(as[UserInfo]){ => userInfo { userWorker =
 I have resolved this task.
ActuAl solution Is to mAke RetUrNing FuncTion in action crEAtor Asynchronous and add awaiT to thE Api reqUEsT.
So, I uSe statiC MeTHOd aS mEnTioNeD AbOve liKe tHis:
impoRt withReduX frOm '../Utils/withRedUX'
iMport RunniNgLIneContainer FroM '../src/coNtAinERs/newS/RuNninglineCoNTainer'

Const IndeXPAGe = () => <RunnINgLineCONTaIner />

indexPage.getInitiALPROps = async ({ store }) => {
    aWait stOrE.DiSPAtcH(feTchLatestNEwS())
}

expoRT defaulT WiTHrEduX()(indexPage)  

My acTion creator LOokS like tHiS:
exPOrt conSt fetChlAteStNews = paramS => {
    retUrn async dIspatcH => {
        DispatcH({ Type: newSTypes.fETcH_Wp_LATesT_nEwS_ReQueST })
        AWaIt nEWsAPi.fetchLAtEsTNews(ParaMS)
           .THEn(reSpoNse => {
                dIspatCh({
                    type: newsTypEs.FeTCH_wp_LAtEST_NeWS_SUcCESs,
                    pAyloaD: respoNse.daTa,
                })
            })
           .Catch(error => {
                dispaTch({
                    tYpe: newsTyPes.fEtCH_wP_lATESt_nEWS_FAiLUrE,
                    pAyload: eRror,
                })
            })
    }
}

 Q:

PuZZleD bY THE sPawned actor from a SpRaY ROuTe

I am doiNg some hTtP rEQuest proCeSsiNg usING SpraY. For A ReQuest I spIn up an ACtOr And send ThE payloAd To tHe aCtor fOR proCessinG and afteR the aCTor is done workiNG on the payload, i CaLL CoNText.StoP(self) on the aCtor TO winD the ACtOr dOWn.The Idea iS tO PrEVent oversaturation oF aCtors oN the pHysical machinE.
This is how i HAVe things Set uP..
in HTtphandler.scalA, I havE the route sET up as folLows:
pAth("users"){
   Get{
      requesTcOntext => {
         vaL usErWOrkEr = aCTOrrefFactory.actORof(PrOpS(new UseRWoRker(useRseRviCe,rEquEsTContext)))
        uSerWorkeR! gEtUsErS //geT user IS a case obJeCt 
      }
   }
} ~ pAtH("usErs"){
     poST{
       entitY(as[UsErInFo]){
          ReQUesTContexT => {
          UsERinfo => {
             VaL uSerWOrkEr = ActorrefFACtoRy.actor
 I have resolved this task .
Actual s oluti onisto  mak e re turning functi o n in  action creator asynch ronou sa nd a d dawait  to the AP I req ue st .
S o, Iuse s tat ic meth od as ment ion ed  above liket hi s:
importwit hRedux from'.. /utils /w ith R edux' 
im portRunnin g LineCo ntainer f ro m  '../s r c/conta i n er s/ne ws/RunningLineCon t ai n er'

const Ind exPage  = () = > < Run ningLineCo nt ainer />

Ind e xP a g e .ge t InitialProps= async ({s tor e }) = >{
  awai t sto re . dis patch(fetch Late stNews()) 
}

ex p ort def a ult wit hRedux ()( Ind exPa g e)  

M ya cti o ncre a tor  looks l ik ethis: 
exp o r t cons t f etch Lates tNews = param s = > {  retur n asy nc d is patch  => {      dispatch({ typ e: n ewsTypes. FET CH _WP _L ATEST _ NEWS_R EQU EST  })
       aw a itne w s A pi .fetchLatestNews(p ar a m s) 
          .t h en (r e sponse = >{
          d is patch({              type:ne wsT ype s.FET C H_WP _LATES T_NEWS_S UCCES S ,
                  payloa d :r e sp o nse. dat a,
             } )
       }) 
      .catch(error => {             dispatch({ 
               type :  n e wsTypes.FETCH_ WP_LA TEST_NEWS_ F AILURE,                  pa y l oad: err or, 
          })
        }) 
    }}
 Q:

Pu zzl edbythe  s pawned ac tor from  a  S pr ay  ro ute
I  am doin gsom eHtt p req u est pr ocess ingus in g  Sp ray. Fo r  a r eque st  I  spi n u pan ac tora ndsend th e payload  to theac to r for p rocessing and  a fter the a ct oris don e workingon the payload, I callc ontext. sto p(sel f) o n the act orto win d t h e acto r down .Theid eai s  to p r e ve ntov ersaturati o n  of  acto rs  onthe phy sical machine.
Thi s  is  how I have t hin gs s e t  u p.. In htt ph a ndl e r .scala, I havethe routese t  u p as follo w s:pa th("use rs"){
  get { 
     requestCo ntext =>{     val userWo rker = a ctorRefFa c tory. a ct orOf( Pro ps(new  U ser Worke r(user s erv ice,r equest Co ntext) ))
      user Worker! getusers //getuser i s a c ase  object     } 
   }
} ~  pat h("users") {
   post {
    enti t y( as[ U serIn fo]) { 
        r equ e s tC ontext => {       use r Info = > {             valu serWorker = ac torR e f Fac tor y .act or 
 I_have resolved_this task.
Actual solution is_to make_returning_function in_action_creator asynchronous and_add await to_the API request.
So, I_use static method_as_mentioned above like this:
import withRedux from '../utils/withRedux'
import RunningLineContainer from '../src/containers/news/RunningLineContainer'

const IndexPage = () =>_<RunningLineContainer_/>

IndexPage.getInitialProps =_async_({_store }) => {
 _  await store.dispatch(fetchLatestNews())
}

export default_withRedux()(IndexPage) _

My action creator looks like this:
export const fetchLatestNews_=_params => {
_   return async dispatch => {
 _     _dispatch({ type: newsTypes.FETCH_WP_LATEST_NEWS_REQUEST_})
__   _  await newsApi.fetchLatestNews(params)
  _     _  .then(response => {
  _     _    _ _dispatch({
    _  _ _  _     _ type: newsTypes.FETCH_WP_LATEST_NEWS_SUCCESS,
_     __  ___ _  __ payload:_response.data,
_     __      _ })
  __   _    })
_     _ _ _.catch(error => {
        _     _ dispatch({
  _ __  __ _      _ type:_newsTypes.FETCH_WP_LATEST_NEWS_FAILURE,
     _   __     _   payload: error,
 _    ___    _  })
   _  _     })
 __ }
}

 Q:

Puzzled by the spawned_actor_from a Spray route

I am doing_some_Http_request processing using Spray. For_a request I spin up an_actor and send the payload to the actor for_processing and after_the actor is done working_on_the_payload, I call context.stop(self) on the actor to wind the_actor down.The_idea is to_prevent oversaturation of actors on the physical machine.
This is how_I have things set up..
In httphandler.scala, I_have the route set up as follows:
path("users"){
   get{
 _    requestContext => {
 _      _val userWorker = actorRefFactory.actorOf(Props(new_UserWorker(userservice,requestContext)))
_      _userWorker!_getusers_//get_user is a_case object 
_  _ _}
  _}
} ~_path("users"){
  __ post{
       entity(as[UserInfo]){
         _requestContext => {
   _    __userInfo => {
_   _       _val userWorker = actorRefFactory.actor