anchor.diff:  
       handle_or_reroute(#events{events = [Evt]}, request_to_file_entry_or_provider(Evt), SessId, HandleLocally, ProvMap);
   
  -handle_cast(#flush_events{provider_id = ProviderId, subscription_id = SubId, notify = NotifyFun} = Evt,
  +do_handle_cast(#flush_events{provider_id = ProviderId, subscription_id = SubId, notify = NotifyFun} = Evt,
       #state{session_id = SessId, event_streams = EvtStms, entry_to_provider_map = ProvMap} = State) ->
       ?debug("Handling event ~p in session ~p", [Evt, SessId]),
       HandleLocally =
  
positive.code: 
      handle_or_reroute(Evt, {provider, ProviderId}, SessId, HandleLocally, ProvMap);
  
  handle_cast(#subscription{id = SubId} = Sub, #state{event_stream_sup = EvtStmSup,
      session_id = SessId, event_streams = EvtStms, entry_to_provider_map = ProvMap} = State) ->
      HandleLocally =
          fun(_, NewProvMap, _) ->
  
negative.code: 
      handle_or_reroute(Sub, request_to_file_entry_or_provider(Sub), SessId, HandleLocally, ProvMap);
  
  do_handle_cast(#subscription_cancellation{id = SubId}, #state{
      event_streams = EvtStms, session_id = SessId} = State) ->
      ?debug("Removing subscription ~p from session ~p", [SubId, SessId]),
      case maps:find(SubId, EvtStms) of
          {ok, EvtStm} -> erlang:exit(EvtStm, shutdown);
          error -> ?warning("Cannot remove subscription ~p from session ~p: "
                            "subscription doesn't exist", [SubId, SessId])
      end,
      {noreply, State#state{event_streams = maps:remove(SubId, EvtStms)}};
  
  do_handle_cast(Request, State) ->
      ?log_bad_request(Request),
      {noreply, State}.
  
  