예제 #1
0
 void ExecConn(LongToken token, bool moveNext)
 {
     while (true)
     {
         try
         {
             token.Connect(this, moveNext);
             token.Begin(this);
             return;
         }
         catch (Exception ex)
         {
             if (!CassandraConnection.IsStreamRelatedException(ex))
             {
                 token.Complete(this, null, ex);
                 return;
             }
             //else
             //retry
         }
     }
 }
예제 #2
0
 public static bool TryParseNumberToken(this string value, out Token numberToken)
 {
     if (value.Contains("."))
     {
         var splitValue = value.Split('.', 'e', 'E');
         if (splitValue.Length > 1 && splitValue[1].Length > 6)
         {
             if (!double.TryParse(value, out var d))
             {
                 numberToken = null;
                 return(false);
             }
             numberToken = new DoubleToken(d);
             return(true);
         }
         if (!float.TryParse(value, out var f))
         {
             numberToken = null;
             return(false);
         }
         numberToken = new FloatToken(f);
         return(true);
     }
     if (!long.TryParse(value, out var l))
     {
         numberToken = null;
         return(false);
     }
     if (l >= int.MinValue && l <= int.MaxValue)
     {
         numberToken = new IntegerToken((int)l);
         return(true);
     }
     numberToken = new LongToken(l);
     return(true);
 }
예제 #3
0
 void ExecConn(LongToken token, bool moveNext)
 {
     while (true)
     {
         try
         {
             int streamId;
             token.Connect(this, moveNext, out streamId);
             token.Begin(this,streamId);
             return;
         }
         catch (Exception ex)
         {
             if (!CassandraConnection.IsStreamRelatedException(ex))
             {
                 token.Complete(this, null, ex);
                 return;
             }
             else if (_alreadyDisposed.IsTaken())
                 return;
             //else
                 //retry
         }
     }
 }
예제 #4
0
 void ExecConn(LongToken token, bool moveNext)
 {
     while (true)
     {
         try
         {
             token.Connect(this, moveNext);
             token.Begin(this);
             return;
         }
         catch (Exception ex)
         {
             if (!CassandraConnection.IsStreamRelatedException(ex))
             {
                 token.Complete(this, null, ex);
                 return;
             }
             //else
                 //retry
         }
     }
 }